Close

Syntax

Close [[#]FileNumber]

Remarks

Closes an open sequential file. FileNumber is the number specified in the Open instruction that opened the file for input, output, or appending. If FileNumber is omitted, all files that were opened with Open are closed.

Sequential files, which are opened with Open and closed with Close, are not displayed in document windows. Although you can use Open to open any file, Open and Close are intended to be used with text files. Close does not display
a prompt when it closes a file. For more information about sequential files, see Chapter 9, "More WordBasic Techniques," in Part 1, "Learning WordBasic."

Example

This example opens a file, inserts a list of AutoText entries in the Normal template and any loaded global templates, and then closes the file:


Open "AUTOTEXT.TXT" For Output As #1
For count = 1 To CountAutoTextEntries(0)
    Print #1, AutoTextName$(count)
Next count
Close #1

See Also

Eof(), Input, Input$(), Line Input, Lof(), Open, Print, Read, Seek, Write