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?



The OSBWRITE command writes an expression to a sequential file starting at a specified byte location. The command takes the general form:

OSBWRITE expression {ON | TO} filevar [AT byte.expr] [NODELAY] [ON ERROR statements]


  • expression specifies the expression to write to the file, 
  • ON | TO filevar specifies the file on which to write the expression,
  • If byte.expr is 0, the write begins at the beginning of the file, 
  • NODELAY forces an immediate write.

ON ERROR statements specifies statements to execute if the OSBWRITE statement fails with a fatal error because the file is not open, an I/O error occurs, or jBASE cannot find the file. If ON ERROR clause is unspecified, and a fatal error occurs, the program terminates.


  • OSBWRITE immediately writes a file segment out to the UNIX, Windows NT, or Windows 2000 file.
  • It is not necessary to specify a length expression because the number of bytes in expr is written to the file.
  • Before OSBWRITE is used, the file of interest must be open first using either the OSOPEN or OPENSEQ command.
  • jBASE uses the ASCII 0 character [CHAR (0)] as a string-end delimiter. Therefore, ASCII 0 cannot be used in any string variable within jBASE. If jBASE reads a string that contains CHAR(0) characters by using OSBREAD, those characters are converted to CHAR(128).
  • OSBWRITE converts CHAR (128) back to CHAR(0) when writing a block of characters.
  • After execution of OSBWRITE, the STATUS function returns either 0 or a failure code:
Status Description
The write was successful
The write failed.

An example of use would be a program statement that writes the data in MYPIPE to the opened file starting from the beginning of the file:


Go back to jBASE BASIC.

Was this article helpful?