UCLOSE Command

The UCLOSE command closes a file variable previously opened with the UOPEN command.

Format

UCLOSE FileHandle THEN statement(s) ELSE statement(s)

Description

The command fails if file-handle is not valid. If an error occurs, the ELSE clause executes. If the UERROR command is called, the appropriate error code is returned.

Example

These statements open and then close the file \books\chap1.txt:

FileName="c:\books\chapt1.txt"

UOPEN FileName FOR READ TO FileHandle ELSE

   PRINT "Unable to open ":FileName

   STOP

END

UCLOSE FileHandle ELSE

   STOP

END

See Also

O/S Interoperability Commands

UCREATE Command

UDELETE Command

UERROR Function

UEXECUTE Command

ULOCK Command

ULSEEK Function

UMESSAGE Command

UOPEN Command

UREAD Command

UREADLINE Function

USYSTEM Function

UWAITFOR Command

UWRITE Command