Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
Syntax: | STS(lun) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Discussion: | The STS function returns the operating status of the specified logical unit number. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Return values: |
Console/terminals:
For devices that previously did not return STS (e.g., spoolers):
Also see STS (Winsock gateway). | |||||||||||||||||||||||||||||||||||||||||||||||||||||
History: |
Bytes 8, 9, and 10 were added to the STS function in Comet version
504.208 in order to enhance the INPUT statement
and as part of the (Easy Scan) mnemonic.
Bytes 11 through 14 were added in Comet2002 Build 306.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
Example 1: |
F2FLAG$ = SUB(STS(0),4,1) ! Get F2 status byte IF F2FLAG$ = "1" THEN GOTO BOTTOMThis example shows how to test for the F2 key. First, the STS function is executed for logical unit number 0, the controlling terminal. The fourth byte of the return value is the F2 status byte -- this is derived with the SUB function. If this byte equals "1" -- indicating that F2 is on -- the program branches to statement label BOTTOM. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Example 2: |
! Byte 17 of STS(0) now returns the COSW major version number, and ! byte 18 of STS(0) now returns the COSW minor version number. ! COSW Version check Work$ = Sts(0) CoswMajVer = Asc(Sub(Work$, 17, 1)) CoswMinVer = Asc(Sub(Work$, 18, 1)) If (CoswMinVer < 19) Print "This program uses features that require COSW version 2.19 (Comet build 309) or later." Goto Progend EndIf | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Example 3: |
Open (LUN) 'sp1' Jobname$ = sub(sts(lun),5,8) + '.' + sub(sts(lun),1,3)This example shows how to retrieve the spool job name. The STS function returns the spool name in the first 3 bytes and the spool job number (of the current job) in bytes 5 through 13. To get the full file name you must concatenate these values and add the "." between job number and the spool name. |