getCommandLine

getCommandLine(): String;

The getCommandLine method of the Process class returns a string containing the current command line of the process of the receiver. A method on a specific process instance performs its action on the owning node (that is, a process.node instance) if the process is not associated with a presentation client.

If the process has an associated presentation client, the action is performed on the presentation client. The presentation client does not have to be the current presentation client or a presentation client attached to the same application server.

Use the Node class getCommandLine method to obtain the file from the application server.

The following example shows the use of the getCommandLine method.

vars
    cmdLine, myOption : String;
    int               : Integer;
begin
    cmdLine := process.getCommandLine;                 // get command line
    // look for my command line option ('myOption')
    int     := cmdLine.pos('myOption', 1);
    if int <> 0 then
        int := cmdLine.pos('=', int) + 1;              // look for '='
        // skip any blanks after the '='
        cmdLine.scanWhile(' ', int);
        // return input up to next blank
        myOption := cmdLine.scanUntil(' ', int);
        write myOption;
    endif;
end;