basic.writet Statement/BASIC Program

basic.writet

Command basic.writet Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description writes a tape record to the attached magnetic media from the specified variable.

If the size of the expression is less than the attached tape block size, it is padded to fill the block size. If it is greater than the block size, it is truncated.

The "then" clause is executed if the "writet" is successful. The "else" or "onerr" clause is executed if the tape unit is not attached or the string value of expression is an empty string ('').

Either "else" or "onerr" may be specified, but not both. In addition, the "onerr" clause may be used to check for tape error conditions by interrogating the "system(0)" function.

See the "then/else construct" for an explanation on the use of "then" and "else" clauses in statements that allow or require them.

Note: To ensure the block is written write a file mark. See "weof" statement. The "weof" will flush the buffer to tape and write an end-of-file mark on the tape.
Syntax writet expression [then | else | onerr statement.block]
Options
Example
record = name 'l#20' : address 'l#15'
writet record else stop
Purpose
Related basic.statements
basic.readt
tcl.set-device
tcl.set-floppy
tcl.set-sct
tcl.set-half
tcl.t-select
tcl.t-att
basic.if
basic.then/else.construct
basic.then
basic.else
basic.onerr
statement.block
tcl.t-stat
basic.weof
basic.system