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 FileHandle is not valid. If an error occurs, the ELSE clause executes. If the uerror() function is called, the appropriate error code is returned.

Example(s)

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

FileName="c:\books\chapt1.txt"
UOPEN FileName FOR READ TO FileHandle ELSE
   PRINT "Unable to open ":FileName
   STOP
END
UCLOSE FileHandle ELSE
   STOP
END