Home / comp / gb.form.dialog / dialog / savefile 
Dialog.SaveFile (gb.form.dialog)
Syntax
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 /comp/gb.form.dialog/textarea to a file selected by the user. If the user cancels the dialog the file is not saved.

Example
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