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?

OPENDEV

Description

Opens a device (or file) for sequential writing and/or reading. It takes the general form: 

OPENDEV Device TO filevar { LOCKED statements } THEN | ELSE statements

Where :

  • Device specifies the target device or file,
  • filevar contains the file descriptor of the file when the open was successful,
  • Statements conditional jBASE BASIC statements.


If the device does not exist or cannot be opened it executes the ELSE clause. Once open it takes a lock on the device. If the lock cannot be taken then the LOCKED clause is executed if it exists otherwise the ELSE clause is executed. The specified device can be a regular file, pipe or special device file. Regular file types only take locks. Once open the file pointer is set to the first line of sequential data.

An example of use is as: 

OPENDEV "\\.\TAPE0" TO tape.drive ELSE STOP

Opens the Windows default tape drive and prepares it for sequential processing.

For more information on sequential processing, see the READSEQ, WRITESEQ


Go back to jBASE BASIC.

Was this article helpful?