1.3 file function

DSKF fixed zero point type function floating-point function
Function
Empty capacity of the specified device is returned.
Format
DSKF([<デバイス名>])
Example
A= DSKF( "BRAM:" )
PRINT DSKF( "" )
Parameter
<デバイス名>… Character string type. The character string that can be specified is limited to the same thing as the provided name. <デバイス名>If the null character string is specified, whether to omit the device used at the end becomes an object.
Return value
<デバイス名>Empty capacity of the device that specifies is returned.
Operation is detailed.
The unit of the returned value is a file block (block = one file 64 bytes). The type of the return value at every the block is a fixed zero point. The maximum value of the fixed zero point type is returned for the size for empty capacity of the specified device to exceed the upper bound of the fixed zero point.
Attention
Bad device name happens when DSKF is done to CD. Device no connected happens to the device not connected.

FILES$ character string type function
Function
The file is retrieved, and the character string of a corresponding Fil name is returned.
Format
FILE([<デバイス名>][<検索ファイル名>][.<拡張子>])
Example
A$= FILE$()
PRINT FILE$( "COM:TEST*.B" )
Parameter
<デバイス名>… Character string type. The character string that can be specified is limited to the same thing as the specified name.
<検索ファイル名>… Character string type. The character string that can be specified is limited to an effective character string (The wild-card is included) as a file name.
<拡張子>… Character string type. The character string that can be specified is limited to an effective character (The wild-card is included) as a file extension.
Return value
The character string with which the retrieved file name is connected is returned.
Operation is detailed.
<デバイス名>The file of the device for which is specified for which is <検索ファイル名>specified is retrieved, and it returns it by the character string that connects all matched the file names. The breakdown of the returned character string is as follows.
.Extension and file name ten characters including period
.Decimal number of five characters of number of file blocks
. CHR$( 13 )
. CHR$( 10 )
Only the backup device is added as for the number of file blocks, and the space for the character enters in "CD" and "COM" (block = one file 64 bytes).
Example
PRINT FILE$( "CD:*.*" )
<デバイス名>The character kind and the number of characters that can be <検索ファイル名>used apply to the rule of the file name. The wild-card can be used for the file name.
<デバイス名>However, the device used immediately before becomes an object when omitted. <検索ファイル名>However, all files that exist in the device become objects when omitted.
<拡張子>However, all file extensions become objects when omitted. When a corresponding file doesn't exist, the null character string is returned.

LOC floating-point function
Function
Acquisition of position where file that has opened is read and written
Format
LOC([#]]<ファイル番号>)
Example
A#= LOC( #1 )
SEEK 1, LOC( #1 )+ 5
Parameter
<ファイル番号>… Numerical value type of fixed zero point type (All the decimal parts are rounded down). The range of an effective numerical value is a value of 1~2.
Return value
The position where the file opened by the OPEN instruction is read and written is returned.
Operation is detailed.
The position where the file opened by the OPEN instruction is read and written is returned.

LOF floating-point function
Function
The terminal at the position where the file that has opened is read and written is returned.
Format
LOC([#]<ファイル番号>)
Example
A#= LOF( #1 )
SEEK 1, LOF( 1 )
Parameter
<ファイル番号>… Numerical value type of fixed zero point type (All the decimal parts are rounded down). The range of an effective numerical value is a value of 1~2.
Return value
The terminal position of the position where the file opened by the OPEN instruction is read and written is returned.
Operation is detailed.
The terminal position of the position where the file opened by the OPEN instruction is read and written is returned.