ProvideX V8.20 > Language Reference > 3. System Functions
532
TCB( ) Function
         Return Task Information
Formats
1. Return Task Information: TCB(tcb_code[,ERR=stmtref])
2. Return Activation Information: TCB(pkg_index,info_reqd[,ERR=stmtref])
3. Return Platform/User Information: TCB(keyword [,arg] [,ERR=stmtref])
Where:
arg
Argument associated with keyword (if required).
info_reqd
Any of the following values: 0 - actual package number, 1 - expiry date,
2- package activation flags.
pkg_index     A number from 0 to the number of packages installed.
keyword
Keyword requesting specific platform or user information.
stmtref
Program line number or label to transfer control to.
tcb_code
Numeric code indicating what type of information is to be returned.
Description
The TCB( ) function returns information for several different purposes. A single tcb_code
specified in the TCB( ) function returns a corresponding system control value ­ see
Format 1: Return Task Information. Two numeric codes (pkg_index,info_reqd) are
required for activation/licensing information ­ see Format 2: Return Activation
Information. Specific keywords are used to return specific information from the OS -
See Format 3: Return Platform/User Information.
Format 1: Return Task Information
TCB(tcb_code[,ERR=stmtref])
When TCB( ) is used with a single code (tcb_code), it returns task information in the
form of a numeric system control value. The codes and their values are listed below:
TCB( ) Return Values
0
Zero (0) - Reserved
1
Zero (0) - Reserved
2
Zero (0) - Reserved
3
Internal system error code.
4
Current statement number. (In a running program, not Command mode.)
5
The line number of the last error.
SETESC statement number.
6
SETERR statement number.
7
Top statement number in GOSUB stack.
8
9
Zero (0) - Reserved for future use.