System

System

System is a class exposing operating system level functions to the scripting language.

Static Methods

static int Command(string aCommand)

Executes a command, and returns the exit code. Using System.Command(), one can call other system programs.

Note

Command is executed with respect to the location the AFSIM application is running from, e.g. the scenario run/startup file location.

Examples:

System.Command("dir *.txt > files.txt");

# Write time and date to file
System.Command("time /T > date.txt");
System.Command("date /T >> date.txt");

# Read file and print to screen
FileIO dateFile = FileIO();
dateFile.Open("date.txt");
writeln(dateFile.Readln(), " ", dateFile.Readln());
string EnvironmentVariable(string aEnvVar)

Returns the value of an environment variable if one exists. If the variable does not exist, an empty string is returned.

double Time()

Return the current system clock time.