Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

TIMEOUT

Description

The statement is used to terminate a read statement when no data has been read in a specified time period. It takes the general from:

TIMEOUT file.variable,Time

Where: 

file.variable specifies a file opened for sequential access. 

time is an expression that evaluates to the number of seconds the program should wait before terminating the READSEQ statement.

TIMEOUT causes subsequent READSEQ and READBLK statements to terminate and execute ELSE statements if the number of seconds specified by time elapses while waiting for data.

If either file.variable or time evaluates to null, the TIMEOUT statement fails and the program enters the debugger.

An example of use is as: 

OPENSEQ "SLIPPERS" TO FILE_VAR ELSE ABORT 201 
TIMEOUT FILE_VAR, 10
READBLK VAR1 FROM SLIPPERS, 15 THEN PRINT VAR1 ELSE
    PRINT "TIMEOUT OCCURRED"
END


Go back  to jBASE BASIC.

Was this article helpful?