OSWRITE

Writes an OS file.

 

COMMAND SYNTAX

OSWRITE Variable ON |TO expression {ON ERROR Statements}

 

SYNTAX ELEMENTS

Variable Specifies the variable to contain the data from the read.
expression Specifies the full file path.  If the file resides in the JEDIFILEPATH then just the file name is required.
ON ERROR Statements Conditional jBC statements to execute if the OSWRITE statement fails with a fatal error because the file is not open, an I/O error occurs, or jBASE cannot find the file. If you do not specify the ON ERROR clause and a fatal error occurs, the program terminates.

 

NOTES

The jBC OSWRITE command writes the contents of an expression to a sequential file. jBASE uses the ASCII 0 character (CHAR(0)) as a string-end delimiter. For this reason, you cannot use ASCII 0 in any string variable in jBC.  If jBC reads a string with a CHAR(0) character, and then the character is converted to CHAR(128), this command converts CHAR(128) to CHAR(0) when writing a block of characters.

 

EXAMPLES

OSWRITE Rec TO "C:\MyDIrectory\MyFile"

 

RELATED COMMANDS

OSOPEN, OSCLOSE, OSBREAD, OSBWRITE, OSREAD, OSDELETE


jBC