Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
TCLREAD Statement (DataBasic MultiValue Compatibility) (M6187AI+TCLREAD_S.htm)
Returns the command line used to execute the current program.
This function is available in all compatibility modes (set with the $OPTIONS statement).
TCLREAD{(element)} varCommandLine
element An integer that specifies a syntax element in the command. 0 specifies the command name.
If element is omitted, TCLREAD returns the complete command line (except for options).
It is recommended that you always specify an element (see examples below).
Note that the element parameter must be enclosed in parentheses.
varCommandLine A variable in which to return the command line:
If there is no syntax element in the specified position, TCLREAD returns a null string.
Item Test1 in BP file contains:
A = 40 B = 30 C = A+B TCLREAD CMD PRINT "The result of ":CMD:"is ":C TCLREAD(0) VERB PRINT "The command was ":VERB TCLREAD(1) PARAM PRINT "The first parameter was ":PARAM TCLREAD(2) PARAM PRINT "The second parameter was ":PARAM TCLREAD(3) PARAM PRINT "The third parameter was ":PARAM
When run as follows:
RUN BP TEST1
this program prints:
The result of RUN BP TEST1 is 70
The command was RUN
The first parameter was BP
The second parameter was TEST1
The third parameter was
Item Test2 in file BP contains:
PARAM = "" I = 0 LOOP TCLREAD(I) PARAM UNTIL PARAM = "" DO PRINT "TCLREAD(":I:") = ":PARAM I += 1 REPEAT
Then entering:
RUN BP TEST2 "myparam"
displays:
TCLREAD(0) = RUN
TCLREAD(1) = BP
TCLREAD(2) = TEST2
TCLREAD(3) = myparam
SENTENCE function. This has the same functionality as the TCLREAD statement, but returns a string containing the command line instead of assigning it to a variable.
SYSTEM(15). This returns the options specified as part of the last TCL statement.