<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


#GET Search:

In File I/O Words in TurboForth Kernal

Word Name: #GET
Type: Standard word
Data Stack Signature: buf_addr file_id -- flag
Return Stack Signature: --
Availability: V1.0  V1.1  V1.2
Description:

Reads a record from an external file into a buffer.

Example:

none

Comment:

Reads a line of input from the file specified by file_id. The address of an appropriately sized buffer (buff_addr) must be supplied.

If the read is successful, the buffer at buff_addr is filled with the data read from the input device, with the first byte being the length count of the data immediately following it. This can be converted into a address/length pair with COUNT.

Returns FALSE if successful or TRUE if not successful. This allows trapping with ABORT" as follows:

MYFILE #GET ABORT" Could not read from file"

If the read fails, IOERR is set to the error code, otherwise it is set to 0.

See Also: #CLOSE  #EOF?  #OPEN  #PUT  #REC 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>