DataBasic Reference > MultiValue Compatibility > Statements and Intrinsic Functions > TCLREAD Statement

Comment on this topic

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)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

TCLREAD Statement

Returns the command line used to execute the current program.

This function is available in all compatibility modes (set with the $OPTIONS statement).

Syntax

TCLREAD{(element)} varCommandLine

Syntax Elements

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:

Example 1

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

Example 2

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

See Also

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.

RealityV15.0Comment on this topic