The global class is the root object in Javascript. More...
The REPORTER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
Detailed DescriptionWhen Reporter is started a single global class object is created.
All of the standard JavaScript functions and properties are available from it. |
Details of functionsBatch() [static]DescriptionThis method can be used to test whether REPORTER is running in batch mode or not. |
No arguments
Returnstrue/false Return typeBoolean |
ExampleTo check if REPORTER is running in batch mode if (Batch()) { do something }
|
The string/item that you want to debug
ReturnsNo return value |
ExampleTo print string "Hello, world!" to the debug log file Debug("Hello, world!");
|
Exit() [static]DescriptionStop execution and exit from script |
No arguments
ReturnsNo return value |
ExampleExit from script with Exit();
|
GetCurrentDirectory() [static]DescriptionReturn the current working directory for REPORTER. |
No arguments
Returnsstring Return typeString |
ExampleTo return the current directory var dir = GetCurrentDirectory();
|
The string/item that you want to print
ReturnsNo return value |
ExampleTo give error "Error: something has gone wrong" to the log file LogError("Error: something has gone wrong");
|
The string/item that you want to print
ReturnsNo return value |
ExampleTo print string "Hello, world!" to the log file LogPrint("Hello, world!");
|
The string/item that you want to print
ReturnsNo return value |
ExampleTo give warning "Warning: something has gone wrong" to the log file LogWarning("Warning: something has gone wrong");
|
Output(string[Any valid javascript type]) [static]DescriptionOutput a string from a script. Note that a carriage return is not automatically added. |
The string/item that you want to print
ReturnsNo return value |
ExampleTo output string "Hello, world!" with a carriage return: Output("Hello, world!\n");
|
SetCurrentDirectory(directory[string]) [static]DescriptionSet the current working directory for REPORTER. |
The directory that you want to change to
Returnstrue if successful, false if not Return typeBoolean |
ExampleTo set the current directory to C:\temp var status = SetCurrentDirectory("C:\\temp");
|
System(string[Any valid javascript type]) [static]DescriptionDo a system command outside REPORTER. |
The system command that you want to do
Returnsinteger (probably zero if command successful but is implementation-dependant) Return typeNumber |
ExampleTo make the directory "example" System("mkdir example");
|
Unix() [static]DescriptionTest whether script is running on a Unix/Linux operating system. See also Windows() |
No arguments
Returnstrue if Unix/Linux, false if not Return typeBoolean |
ExampleTo test if the OS is Unix if ( Unix() )
|
Windows() [static]DescriptionTest whether script is running on a Windows operating system. See also Unix() |
No arguments
Returnstrue if Windows, false if not Return typeBoolean |
ExampleTo test if the OS is Windows if ( Windows() )
|
debug() [static] [deprecated]This function is deprecated in version 12.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionPlease use Debug() instead |
No arguments
ReturnsNo return value |
exit() [static] [deprecated]This function is deprecated in version 12.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionPlease use Exit() instead |
No arguments
ReturnsNo return value |
output() [static] [deprecated]This function is deprecated in version 12.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions. DescriptionPlease use Output() instead |
No arguments
ReturnsNo return value |