INFO() Function - Get System Information

Syntax

INFO(int,int{,ERR=lineref})

Description

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

The INFO() function returns system information strings.

Parameter

Description

int,int

Argument used to determine the desired string.

ERR=lineref

Branch to be taken if an error occurs during execution.

Note: for revisions 2.1 and later of PRO/5 and Visual PRO/5:

It may take up to two minutes for the INFO(2,X) function to return information when updating licenses. If PRO/5 is in "nag" mode, INFO(2,0) and INFO(2,1) will return 1. "Nag" mode is the absence of a valid license file that halts the operation of the BASIS product. A message box appears randomly every 15-30 minutes reminding the user of the absence of a valid license. Pressing OK resumes the operation.

Arguments

Information Returned

INFO(0,0)

Operating system name for which PRO/5 is compiled.

INFO(0,1)

Operating system version for which PRO/5 is compiled.

INFO(0,2)

BASIS "port ID."

INFO(0,4)

PRO/5 build date and time

INFO(1,0)

CPU ID (or CPU family) for which PRO/5 is compiled.

INFO(2,0)

Total number of user licenses (4-byte binary string). For versions prior to 2.1, this argument returns the total number of foreground user slots (binary string).

INFO(2,1)

Total number of available licenses, those not in use (4-byte binary string). For versions prior to 2.1, this argument returns the number of free foreground user slots (binary string).

INFO(2,2)

UNIX: Binary strings of 32 bits (4-byte binary string).

Windows: Zero (0).

For versions prior to 2.1, this argument returns the total number of background user slots (binary string).

INFO(2,3)

UNIX: Binary strings of 32 bits (4-byte binary string).

Windows: Zero (0).

For versions prior to 2.1, this argument returns the number of free background user slots (binary string).

INFO(2,4)

Current user slot number (binary string). In versions 2.20 and later of PRO/5 and Visual PRO/5, INFO(2,4) returns a four-byte value instead of a two-byte value. Any applications that depend on this value being a two-byte value may require modification, for example, creating a temporary file name. The following is an example of how to use the new return value to create a temporary file name:

    rem 0 -- (Determine Temporary File Name)
    get_filename:
    tpm__info$=info(2,4)
    tpm__info$=tpm__info$(3,2),
:    tpm__info=dec($00$+tpm__info$),
:    tpm__chan=unt,
:    tpm__done=0
    repeat
        tpm__tmpfile$="_{"+str(tpm__info:"00000")+"}.tmp",
:            tpm__done=1
        open (tpm__chan,err=after_open)tpm__tmpfile$
        tpm__done=0
        after_open:
        close (tpm__chan)
        if tpm__done=0 then
:           tpm__info=tpm__info+1;
:         if tpm__info>99999 then
:             tpm__info=0
:         fi
:        fi
    until tpm__done

    return

INFO(2,5)

Last background process number started (binary string).

INFO(2,6)

In PRO/5, VPRO/5 4.10, and BBj 3.01 and higher, this function returns the license expiration date in Julian date format (binary string). 2147483647 ($7fffffff$) indicates a permanent license or that PRO/5 is running without a license. The expiration date applies to the license checked out when starting PRO/5. If the license was updated after PRO/5 was started, then PRO/5 must be restarted to return the updated expiration date.

Example 1

10 LET A=DEC(INFO(2,6))-JUL(0,0,0)
20 IF A<30 THEN PRINT "This license will expire in",A," days"

Example 2

10 LET A=DEC(INFO(2,6))
20 IF A=2147483647 THEN PRINT "This license will not expire"
20:ELSE PRINT "This license will expire on ",DATE(A)

INFO(3,0)

Four-byte process ID.

INFO(3,1)

Eight-byte string, where the first four bytes are identical to INFO(3,0). The last four bytes are set to the local IP address if network access is enabled using SETOPTS byte 4, bit $20$. If network access is not enabled, the last four bytes of INFO(3,1) return $00000000$.

INFO(3,2)

User login ID.

INFO(3,3)

User description.

INFO(3,4)

Current host name.

INFO(3,5)

Not yet implemented (will return features of licensed product).

INFO(3,100)

Novell NetWare: Name of the server PRO/5 was invoked from, or the empty string, if none.

INFO(3,101)

Novell NetWare: Volume or drive PRO/5 was invoked from, minus the final colon.

INFO(3,102)

Novell NetWare: Full path of the PRO/5 executable, minus any server or volume information.

INFO(4,int)

Values of any environment variable set. int ranges from zero to the maximum number of environment strings, minus one.

INFO(5,0)

LIM, logical page size for MS-DOS.

INFO(5,1)

Number of logical pages currently available for allocation for MS-DOS.

INFO(6,0)

Name of the GUI system, if applicable. This will be "WINDOWS", "XMotif", or the empty string (indicating that GUI enhancements are not available).

INFO(6,1)

A binary string containing the maximum possible START size, in 256-byte pages. This value does not indicate the exact amount of memory available, and it may not be possible to use a START size as large as the returned value.

INFO(6,2)

The result is either "<>|", indicating that the operating system supports pipes, or the empty string if the operating system does not support pipes.

INFO(6,3)

Number of significant digits (as a binary string) for Business Math fields.

All other argument values for INFO result in an error. Use the DEC() function to retrieve the value of details returned as a binary string.

Some systems may return additional INFO() values. See your operating system manual set for additional information.

Examples

>PRINT INFO(4,1)
PATH=/USR/BBX
>PRINT INFO(3,3)
BBX USER

See Also

Functions - Alphabetical Listing