TCB() Function - Task Control Block

Syntax

TCB(int{,ERR=lineref})

Description

For BBj-specific information, see the TCB() Function - BBj.

The TCB() function returns information on the current state of the application.

TCB(int)

Return Value

0

!ERROR=20.

1

!ERROR=20.

2

!ERROR=20.

3

0 (not currently in use).

4

Current line number.

5

Line number of statement to retry on error.

6

Current SETESC value.

7

Current SETERR value

8

Current "return" address; line number of return address, or "top" of current looping command (zero if no active loop or subroutine call).

9

0 (not currently in use).

10

Last host error (see note below).

11

Last channel reporting error

12

Last channel used

13

Current public program depth

14

Current PRECISION.

15

Current START size.

16

Length of string matched by MASK() function.

17

User-defined function depth.

18

Last CPL() depth.

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 while a GUI window had focus.

These values are additive.

The SETESC verb resets TCB(19) to 0.

20

File system information, in a 4-byte integer:

$01$ Data Server access is available.

$04$ File system supports 4GB (PRO/5 Rev. 2.x only) or 64-bit (PRO/5 Rev. 3.x and higher) files.

$08$ File system supports C-ISAM file.

$10$ File system supports BTRIEVE files.

Use BIN(TCB(20),4) to retrieve the bits and the AND() function to test the bits.

NOTE: The TCB(10) returns the last error code reported by the host. If the value returned is negative, the absolute value of the TCB(10) indicates the operating system error. See TCB() for the specific system in the Installation and Configuration Guide. PRO/5 errors do not modify the TCB(10). Interrupting a program will generally modify the TCB(10).

Examples

2010 READ (2,ERR=9100)A$

9100 PRINT "ERROR AT LINE",TCB(5)

See Also

Functions - Alphabetical Listing