UNT (function)
Lowest Channel Number for File
This numeric function returns the lowest channel number on which a file is opened. If the file is not open the result is 0 (zero).
Syntax
Section titled “Syntax”UNT (file-name)file-name is the name of a file.
Remarks
Section titled “Remarks”This numeric function is generally available starting with release level 8.3.0.
If the file is open the lowest possible value returned by UNT is 1 because a normal task or ghost task is always using channel 0. If the file is not open the result is 0.
If the channel is opened with the DLINK option, specifying either the data file, secondary key or text field file name will have UNT return the channel used to open the Link.
Examples
Section titled “Examples”LET CH = UNT("CUST.DAT")returns the lowest channel on which the file CUST.DAT is opened.
OPEN(1,OPT="DLINK")"OELCUST";X=UNT("OECUST");Y=UNT("OECUSTsk");X and Y will return the value 1.
See also
Section titled “See also”OCH and UNT system variables
From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF