num_args()

num_args() returns the total number of the arguments passed when running the application.

Syntax

CALL num_args()

Possible values

any INTEGER

Usage and examples

num_args() returns an INTEGER equal to the number of arguments passed when running the application:

DISPLAY "Total number of arguments passed: ", num_args() AT 4, 5

will result in this display:

Together with arg_val(), num_args() is used to pass the specified parameter to the application - as in this simple program:

MAIN

  DEFINE i INT

    FOR i = 1 TO num_args()

      DISPLAY "Argument ", i, " is ", arg_val(i) AT i + 3, 5

    END FOR

  CALL fgl_getkey()

END MAIN

num_args() will return the number of arguments passed when running the application no matter how you have run it - in LyciaDesktop or LyciaWeb; from LyciaStudio or from the command line - the same as arg_val().

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.