These commands can give you the information you may need on a certain file.
Get the filename of the file this buffer has access to.
A filename is maximum 32 characters long, and enough space has to be provided for the return string (no problem in Sbasic).
Sbasic name$ = FILEname$(#bufferid) Assembler FNAM bufferid return string filename C long DDfilename(long bufferid, char *return); errors, code, meaning itnf -7 invalid bufferid
Get the filedevice of the file this buffer has access to.
A filedevice is maximum 32 characters long, and enough space has to be provided for the return string (no problem in Sbasic).
Sbasic device$ = FILEdevice$(#bufferid) Assembler FDEV bufferid return string filedevice C long DDfiledevice(long bufferid, char *return); errors, code, meaning itnf -7 invalid bufferid
Find out how many records are in this file. This function returns the total amount of records, and doesn't take any index into consideration.
Sbasic number = COUNTall(#bufferid) Assembler CNTA bufferid return long number C long DDcountall(long bufferid, long *return); errors, code, meaning itnf -7 invalid bufferid (or indexid actually)
Find out the current value for the inter-record-space.
Sbasic irs = GET_IRS(#bufferid) Assembler GIRS bufferid return short irs C long DDget_irs(long bufferid, short *return); errors, code, meaning itnf -7 invalid bufferid
Find out whether the file this buffer works on is memory-based (status=0), or disk-based (status=1).
Sbasic status = FILEstatus(#bufferid) Assembler GFST bufferid return short status C long DDfilestatus(long bufferid, short *return); errors, code, meaning itnf -7 invalid bufferid
Find out whether this buffer is read/write (status=0), or view only (status=1).
Sbasic status = VIEWstatus(#bufferid) Assembler GVST bufferid return short status C long DDviewstatus(long bufferid, short *return); errors, code, meaning itnf -7 invalid bufferid