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?

WRITE

Description

The WRITE statement allows a program to write a record into a previously opened file.

WRITE variable1 ON|TO { variable2,} expression {SETTING setvar} {ON ERROR statements}

Where: 

  • variable1 is the identifier containing the record to write,
  • variable2, if specified, should be a previous opened variable to a file using the OPEN statement. If variable2 is unspecified, the default file variable is assumed.
  • the expression should evaluate to a valid record key for the file.
  • If specifying the SETTING clause and the write fails, it sets setvar to one of the these values.

If holding a lock on the record by this process, it is released by the WRITE. If it is desired to retain a lock on a record, it should be stated explicitly with the WRITEU statement.

An example of use would be as:

OPEN "DICT Customers" TO DCusts ELSE ABORT 201, "DICT Customers"

WRITE Rec ON DCusts, "Xref" ON ERROR
    CRT "Xref not written to DICT Customers"
END


Go back to jBASE BASIC.

Was this article helpful?