TCB() Function - BBj


For this topic's original documentation, see the TCB() Function - Task Control Block.

BBj-Specific Information

Syntax

TCB(int1{,int2}{,ERR=lineref})

In BBj 17.0 and higher, the optional int2 parameter specifies a program call level in the range 0 through TCB(13). When used with int1 values 2, 3, 4, 5, 6, 7, 8, 13, 23, and 24, this returns information about the specified program level.

TCB(int)

Return Value

2

In BBj 9.0 and higher, TCB(2) returns 1 if the program is protected or 0 if it is not. PRO/5 throws an error for TCB(2).

3

TCB(3) returns 0 if the program has line numbers or 1 if line numbers are not used. PRO/5 always returns 0 for TCB(3).

4-8

If the program does not use line numbers, TCB(4) through TCB(8) return the ordinal line number within the source program.

9

In BBj 3.01 and higher, TCB(9) returns the number of significant digits for switching over from standard notation to scientific notation. The default is 16 digits.

10

May return a Java error instead an OS error.

In BBj 6.0 and higher, immediately after throwing !ERROR=0 attempting to read a file, TCB(10) returns the byte offset that was locked in the file. This value, when combined with the BBjOpenFileInfo::getExtracted() method, can be used to identify the holder of the lock and/or to force-close the file that holds the lock, if deemed appropriate.

18

[Last CPL() depth] is not supported in BBj.

19

One or more flags indicating how an ESCAPE was generated.

1

User pressed the escape key sequence (typically Ctrl+C) while a terminal window had focus.

2

User clicked the close box or pressed Alt+F4 on a terminal window.

4

User pressed CTRL+BREAK (Cmd+Period in macOS) while a GUI window had focus.

8

Thin client connection was lost.

These values are additive.

The SETESC verb resets TCB(19) to 0.

21

In BBj 14.00 and higher, TCB(21) returns the last SQL channel reporting an error.

22

In BBj 14.00 and higher, TCB(22) returns the last SQL channel used.

23 In BBj 20.20 and higher, TCB(23) returns the line number of the current DATA statement.
24 In BBj 20.20 and higher, TCB(24) returns the index number of the current expression within the current DATA statement.

See Also

Functions - Alphabetical Listing

PGM() Function - BBj