getCmdLineArg()

The system function SysLib.getCmdLineArg returns the specified argument from the list of arguments with which the EGL program was invoked. The specified argument is returned as a string value.

  SysLib.getCmdLineArg(index INT in)
  returns (result STRING)
result
The result can be any character item.
index
The index can be any integer item.
  • If index = 0, the command name is returned.
  • If index = n, the nth argument name is returned.
  • If n is greater than the argument count, a blank is returned.
The following code example loops through the argument list:
count int;
argument char(20);

count = 0;
argumentCount = SysLib.getCmdLineArgCount();

while (count < argumentCount)
   argument = SysLib.getCmdLineArg(count)
   count = count + 1;
end

The SysLib.getCmdLineArg function is supported only in Java™ environments.

Use the SysLib.getCmdLineArgCount function to get the number of arguments or parameters that were passed to the main EGL program at the time of its invocation.

Related concepts
Syntax diagram for EGL functions

Related reference
EGL library SysLib
getCmdLineArgCount()

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.