Input$ (Function)
Reads in the specified number of bytes of binary data.
Input$(<No. of Characters>[,#<File No.>])
Parameters
<No. of Characters>
|
The number (integer) of bytes of data to be input.
|
<File No.>
|
The file number (integer) of the file with the data to be read in.
|
Return Value
Returns the value of the character type string.
The content of the value is the binary data that has been read in.
Description
The maximum that can be specified as the No. of Characters is 255 characters.
Waits until the length of data specified in No. of Characters has been input.
If the File No. is omitted, data is read in from the macro console.
When the number of characters read into the macro console communications buffer exceeds the specified No. of Characters, the excess is read in at the next Input$ function.This also applies to files.
When character strings are enclosed within double quotation marks (" "), the double quotation marks are also recognized as characters.
Example
Read in 6 bytes of binary data from the file.
Open "C:\input.dat" FOR INPUT As #1
DATA$ = Input$(6,#1)
Close #1
The result is as follows:
DATA$="BINDATA" (The data input from the file)