beautypg.com

Argox PA-20 Basic Programming Manual User Manual

Page 79

background image

PT-Basic Programming Manual Ver. 1.00

78/143

BGET

Purpose: To read a byte from a file. The current position is updated

after reading.

Syntax: STR% = BGET # FILEID%

Example: STRING1%=BGET # FILEID%

PRINT CHR$(STRING1%)

Description: STR% is an integer variable to be returned to the result.

FILEID% is an integer variable indicating the file handle.

You can use the GET_FILE_ERROR command to get the

file error code. Possible error codes and their interpretation

are listed below:

GET_FILE_ERROR Meaning

2

File specified does not exist.

7

File not opened

BGETEXT

Purpose: To read a specified number of bytes from a file. The current

position is updated after reading.

Syntax: STR$ = BGETEXT(N%) # FILEID%

Example: STRING1$=BGETEXT(5)#FILEID%

PRINT STRING1$

PRINT "STRING LEN=",LEN(STRING1$)

Description: STR$ is a string to be returned to the result.

N% is an integer indicating the number of bytes to be read.

FILEID% is an integer variable indicating the file handle.

You can use the GET_FILE_ERROR command to get the

file error code. Possible error codes and their interpretation

are listed below:

GET_FILE_ERROR Meaning

2

File specified does not exist.

7

File not opened