Closing a file, menu, listbox, database or cursor

close

Close a file, menu, listbox, database or cursor


SYNTAX

close file_id [, file_id]…

close listbox_id [, listbox_id]…

close database_id [, database_id]…

close cursor_id [, cursor_id]…

Close the object or objects specified.


Keyed file


close file_id [, file_id]…

Closes the specified keyed file or files. The content of the file record buffer(s) remains unchanged, but if it contained a locked record then closing the file unlocks it. If the file is later reopened, the record must be read again before it is available for update. Closing a file with the close command does not affect the position of the pointer for subsequent next and prev type commands, and cached file information is retained.

The closefile command can also be used to close a file. This command resets the file position and releases other information about the file currently cached on the server.

There is no specific limit to the number of Sculptor keyed files that may be open at any one time, available memory being the only limiting factor. The exception to this is that clients who connect to kfserver using earlier versions of Sculptor than 4.2 are restricted to 400 open files. See Servers.

The number of files that may be open at any one time is also dependent on the operating system. If the maximum is exceeded, the program aborts. Note that each secondary index for an open file counts as an extra file.

This command may also be used to close a file in an ODBC database.

Note

  • A file may also be closed by closing a record buffer attached to it (close record_id). However, it is more meaningful to use the file_id, and this is therefore the recommended option.

  • The declarations !file and!ofile declare files which are initially closed and open respectively.

  • The clear command clears a file record buffer even if the file is closed. This may be prevented by means of the preserve command.

  • An attempt to close a file that is already closed is ignored.

  • The close # command is used to close a sequential file. This type of close requires its own statement line. It cannot be mixed with a close file_id command.

EXAMPLE

close DemoData

Menu


close menu_id [, menu_id]…

Makes a menu and all its items invisible and unavailable. In order to return control to the menu, use the open command.

Note

  • The hide command is used to make windows, textboxes and buttons invisible.

  • If the menu is already closed the command is ignored.

EXAMPLE

close MainMenu

Listbox


close listbox_id [, listbox_id]…

In programs compiled with Version 4.2 or later, this command can be used to close the drop-down list of a listbox. In earlier versions, close listbox_id was equivalent to hide listbox_id. Use the declaration !compat open = 3 to retain the old behaviour. It is recommended that programs using the close command to make a listbox invisible are modified to use hide.


Database, cursor


close database_id [, database_id]…

close cursor_id [, cursor_id]…

These commands are only relevant to ODBC.


RELATED TOPICS

![o]file

closefile

close #

open

ODBC