getCmdLineArg

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


getCmdLineArg syntax diagram

characterItem

The characterItem 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 = getCmdLineArgCount();

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

The getCmdLineArg function is supported only in Java environments.

Use the 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 reference
getCmdLineArgCount