Chapter 3 DynaScript Predefined Objects
The system
object
has these methods:
system.Exec(cmd)
Executes a command outside the Dynamo Script Interpreter.
Boolean. Returns true or false indicating whether or not the call succeeded:
This example launches the Windows Notepad utility.
<--SCRIPT
// Launches notepad
system.Exec( "notepad.exe" );
-->
system.GetCWD( )
Returns the current working directory.
String.
To return the current directory:
<!--SCRIPT
// Prints the current working directory
document.WriteLn( system.GetCWD() );
-->
system.GetEnv(env)
Searches the environment for an environment
entry matching env
, and
returns its value.
String or null if no matching entry found.
This example retrieves the environment's PATH entry:
<!--SCRIPT
path = system.GetEnv( "PATH" );
-->
system.SetEnv(env,value,overwrite)
Searches the environment for an entry matching env
.
If there is no such entry, an entry is created and set to value
;
otherwise, if overwrite
is
true the entry is set to value
.
This example modifies the system path.
<!--SCRIPT
// Adds e:\src to the Environment System Path
path = system.GetEnv( "PATH" );
path = path + "e:\src;";
system.SetEnv( "PATH", path, true );
-->
Copyright © 1999 Sybase, Inc. All rights reserved. |