GETARG - get a command line argument.

Usage:

const
    MAXSTR = n;
type
    string = packed array[1..MAXSTR] of char;
var
    s : string;
function
getarg(i:integer; var s:string; size:integer):integer;
    extern;
...
len := getarg(i, s, MAXSTR);

Description:

GETARG gets the i'th argument from the command line with which the Pascal program was invoked, and places it in the string "s". A null byte marks the end of "s". The command name is argument zero. If the i'th argument was not present, GETARG returns -1; otherwise, it returns the length of the argument. "size" gives the maximum number of characters that may be written into the string "s". GETARG assumes that "s" is actually at least that large.

See Also:

expl pascal lib iargc

Copyright © 1996, Thinkage Ltd.