comp • gb.form.dialog • dialog • savefile

Dialog.SaveFile (gb.form.dialog)

Static Function SaveFile ( ) As Boolean

Calls the file standard Dialog to get the name of a file to save.

Returns TRUE if the user clicked on the Cancel button, and FALSE if the user clicked on the OK button.

This example shows how you can save the content of a textarea to a file selected by the user. If the user cancels the dialog, the file is not saved.

Examples

Public Sub ButtonSave_Click()
  Dialog.Filter = ["*.txt", "Text Files"]
  If Dialog.SaveFile() Then Return
  File.Save(Dialog.Path, TextAreaEdit.Text)
Catch
  Message.Info(Error.Text)
End