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

Name Description
DefExtension Default file extension
ExplorerStyle Make the dialog appear like Windows Explorer
File The currently selected file
FileCount Number of selected files
Files Collection of all selected file names
FileTitle Caption to appear in the title bar
FilterCaption Caption of the specified filter
FilterCount FilterCount property
FilterExtension FilterExtension property
FilterIndex Index of the required filter
InitialDir Initial folder to be shown in the dialog
MultiSelect Allow multiple files to be selected
OverwritePrompt Prompt for file overwrite if required
Title Caption to show in the title bar

Methods

Name Description
AddFilter Add a file type filter
Name, Extention
Show Show as a modal dialog
FormOwner, OKPressed

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020