Save File Dialog (PRIM_APPL.ICommonDialogFileSave)

Windows File Save dialog

Ancestors - None

Details

Use the SaveAs dialog to enable the end-user to save a file.

Example

This example prompts for a filename and then saves the list as that file.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Theme(#SYS_THEME<2015Blue>) Clientwidth(551) Clientheight(301) Left(165) Top(204) Width(567)
 
   Define_Com Class(#PRIM_PHBN) Name(#Save) Caption('Save') Displayposition(1) Left(416) Parent(#COM_OWNER) Tabposition(1) Top(264) Width(129)
 
   Def_List Name(#List) Fields(#xDemoNumber) Type(*Working)
 
   Evtroutine Handling(#Com_owner.CreateInstance)
 
      Begin_Loop Using(#xDemoNumber) To(10)
         Add_Entry To_List(#List)
      End_Loop
 
   Endroutine
 
   Evtroutine Handling(#Save.Click)
 
      #Com_owner.Save
 
   Endroutine
 
   Mthroutine Name(Save)
 
      Define_Com Class(#Prim_appl.ICommonDialogFileSave) Name(#FileSave) Reference(*Dynamic)
 
      #FileSave <= #sys_appln.CreateFileSaveDialog
      #FileSave.File := "SuggestedName.txt"
 
      If (#FileSave.Show)
 
         Use Builtin(Transform_list) With_Args(#List #FileSave.File T) To_Get(#IO$STS)
 
      Endif
 
   Endroutine
 
End_Com

Properties

NameDescription
DefExtensionDefault file extension
ExplorerStyleMake the dialog appear like Windows Explorer
FileThe currently selected file
FileCountNumber of selected files
FilesCollection of all selected file names
FileTitleCaption to appear in the title bar
FilterCaptionCaption of the specified filter
FilterCountFilterCount property
FilterExtensionFilterExtension property
FilterIndexIndex of the required filter
InitialDirInitial folder to be shown in the dialog
MultiSelectAllow multiple files to be selected
OverwritePromptPrompt for file overwrite if required
TitleCaption to show in the title bar

Methods

NameDescription
AddFilterAdd a file type filter
Name, Extention
ShowShow as a modal dialog
FormOwner, OKPressed

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2