DataBasic Reference > Statements and Intrinsic Functions > W > WEOF Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

WEOF Statement (DataBasic) (m618703+weof_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

WEOF Statement

Writes an End-Of-File mark (EOF) to tape.

Syntax

WEOF [THEN statement(s) ELSE statement(s)]

Syntax Element

statement(s) is either a THEN or an ELSE clause (or both). A statement must be included. The THEN clause is executed if the write is successful. The ELSE clause is executed if the tape unit has not been attached.

Comment

If you have not attached the tape (T-ATT command), the system displays the error message:

[1129] NO SUCH TAPE ASSIGNMENT EXISTS

and your program is terminated.

If you want to write to an unlabelled tape you must first assign/attach the tape using LABEL =0 in the ASSIGN or T-ATT command. You can also use RUN with the T option if you want to write to tape without a label.

For more information on tape handling, refer to Overview of Tape Operations.

Examples

WEOF ELSE STOP

Writes an EOF mark. If the tape unit is not attached, the program terminates.

WEOF THEN GOTO 100 ELSE 
  PRINT "TAPE NOT ATTACHED"
  STOP
  END

Writes an EOF mark and transfers control to statement 100. If the tape is not attached, displays message and terminates program.

RealityV15.1 (MoTW) Revision 7Comment on this topic