Retrieving command line arguments (sys.Arg)


Command line arguments to a Sculptor program

An array of indeterminate size, whose elements are the command line parameters, or arguments, of the program that refers to it.

Command line: sagewc invoices SMITH 46500

sys.Arg[1] = “sagewc”
sys.Arg[2] = “invoices”
sys.Arg[3] = “SMITH”
sys.Arg[4] =46500”
sys.Arg[5] = " "

The actual length of each element is set to the length of the text that it references. Reference to a non-existent value returns an empty string.

The values in sys.Arg cannot be altered.

The function call:

dim(sys.Arg, 1)

returns the number of command line arguments.


ArgPath = sys.Arg[3]
if (ArgPath <> "") {
     if (SplitDir = "") {
          ArgPath = cwd(0) / "/" + ArgPath

     if (Display(ArgPath) <> OKAY) {
          error "Can't find file: " + ArgPath