Close Method

Closes the Document or Window. When called off the Documents collection, this method closes all open documents in the iFIX WorkSpace. When used with the Document object, this method closes the Document object. This is equivalent to selecting Close from the File menu.

Documents Collection Syntax

object.Close [SaveChanges], [CloseOptions]

Properties

The Close method syntax has these parts:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

SaveChanges

Long. (Optional)  

Valid entries:
1 – Saves the changes without prompting. (default)
2 – Does not save the changes.
3 – Prompts the user to save changes.

CloseOptions

Long. (Optional)  

Valid entries:
1 – Closes all files. (default)
2 – Only closes the files that are not hidden.
3 – Only closes the hidden files.

Remarks

This method removes the document(s) from the Documents Collection.

Note that if the Close method is called for newly created pictures with a SaveChanges option of 1 or 3, the user is prompted to save changes regardless. This is because pictures cannot be saved as their default name (e.g. “Untitled#”).

Document Object Syntax

object.Close [SaveChanges], [CloseOptions]

The Close method syntax has these parts:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

SaveChanges

Long. (Optional)  

Valid entries:
1 – Saves the changes without prompting. (default)
2 – Does not save the changes.
3 – Prompts the user to save changes.

CloseOptions

Long. (Optional)  

Valid entries:
1 – Close file. (default)
2 – Close file, only if it is visible.
3 – Close file, only if hidden.

Remarks

If possible, always make this call the last line in your script. Note that when the Close method is used, and the document being closed is the document that contains the script, the call must be the last line in the script. Otherwise, you may experience unexpected behavior when executing the script.

If the Close method is not called from picture being closed and is not the last line in your script, be certain that the operation is complete before the rest of the script continues to execute.

 

Example

Applies To