Close [Window]

The Close method closes this view, optionally asking to save changes first. Returns a Boolean. It returns 'True', is the process is successful and the window is closed, otherwise it returns 'False'.

Syntax

object.Close( SaveChanges, FileName )

Parameter

Type

Default

Description

SaveChanges

SrfSaveTypes

srfSaveChangesYes

optional; This provides the options of saving the file before closing, i.e., saving the current changes, not saving the current changes, or to ask the user whether to save the current changes or not.

FileName

String

""

optional; This provides the path, file name, and file extension. If this is not specified the FullName property is used.

Remarks

  • srfSaveChangesYes prompts the user to save changes if this is the last open view on the document and the document has been changed.

  • Returns true if the window was closed.

  • The window may not be closed if srfSaveChangesYes operation was canceled by the user.

Example 1

This example demonstrates how to automatically save the contents of a window as DGRID1.SRF.

Window.Close(SaveChanges:=srfSaveChangesYes,FileName:=SurferApp.Path+"\Samples\dgrid1.srf")

Example 2

This script displays all the methods and properties in the Window object.

Used by: Window object