System Functions
PUB( ) List Public Programs
   
Format PUB(index[,ERR=stmtref])

Where:

index Index in the ADDR table for the entry to be returned. Numeric expression. (Base 0)
stmtref Program line number or statement label to which to transfer control.
   
Returns String, containing information for the program identified by index.
   
Description The PUB( ) function returns a string reporting the names, starting addresses and sizes of all programs for which the ADDR directive is active. The information is returned as a character string containing the name and description of each program addressed.

The index indicates the relative program number in the ADDR table. ProvideX updates the table to account for your subsequent ADDR and DROP directives and changes index numbers accordingly (They're not static.) ProvideX returns Error #41: Invalid integer encountered (range error or non-integer) if no entry in the ADDR table exists for your given index.

The table below lists the contents of the string returned by the PUB( ) function:

Byte Contents
1 to 2 Program size in bytes
3 $01$
4 to 13 Reserved for ProvideX use
17 + Fully qualified pathname to the program
   
See Also ADDR Directive,
DROP Directive.
   
Examples 0010 LET A$=PUB(1)
0020 PRINT A$(17) ! C:=$433A$, starts at position 17 (see below)
0030 PRINT HTA(A$)
-: run
C:\MANUALS\PVX\TEST
03BD0000000080C51000000000000000433A5C4D414E55414C535C5056585C54455354