<<< file: print.argument.clg >>>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:
class PRINT.ARGUMENT: Primary class for the Print.Argument program.
import Gilda.Basis :type C.String is @C[?] byte
:
:...............................................................................
gilda Print.Argument ROOT
end
<<< end file: print.argument.clg >>>
<<< file: print.argument.g >>>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:
method PRINT.ARGUMENT: A program that prints any given arguments.
entry Argc word, &Number of arguments
Argv[?] C.String, &Each argument as a null terminated string
Envp[?] C.String :Each environment variable
local Env C.String :Current environment variable
:
:...............................................................................
PRINT "Argc =", Argc; Print the number of arguments.
PRINT
DO I = 0 to Argc - 1: DO over each argument,
PRINT "Argv", I, "=", Argv[I]; Print: Argv # = <Argument>
-
PRINT
I = 0
Env = Envp[0]; At the first variable.
DO while @Env`C: DO while there are more variables.
PRINT Env; Print an environemnt variable.
I += 1
Env = Envp[I]; Get the next variable.
-
return
<<< end file: print.argument.g >>>