Skip to content

ARG

Arguments for Thoroughbred Basic Startup

This string function returns the individual argument specified from the operating system command that was issued to start this Thoroughbred Basic task.

ARG (numeric-value [,ERR=line-ref|,ERC=error-code])
numeric-value
is a positive integer, zero-based, specifying which positional parameter this function is to return.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

If numeric-value exceeds the number of parameters minus one, an ERR=17 results.

If you start Thoroughbred Basic with the following command:

./basic T5 data IPLWIN

then the ARGC variable will have a value of 4. To see what you entered you can execute the following Thoroughbred Basic statement:

00010 FOR X = 0 TO ARGC - 1 ; PRINT ARG(X) ; NEXT X

This statement will print:

./Basic
T5
data
IPLWIN

ARGC system variable

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF