Put file name

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO Windows,Linux


Put file name (path [,dialog-title] [,prompt] [,default]) Returns err-code


Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command opens the standard Save as… dialog for the current Operating System, in order to obtain the path of a file from the user. You would typically use this command to prompt the user for the path of a new file. If you want to prompt the user to enter the path of an existing file, use the Get file name command instead.

You can pass a title for the dialog, in dialog-title. You can specify a default value for the entry field in default.

Put file name returns the full pathname of the file the user entered in path, or empty if no file was entered (that is, the Cancel button was clicked). The named file is not opened or created.

It returns an error code (See Error Codes), or zero if no error occurs.


; prompt the user for a file name, default to myfile.txt
Put file name (lPathname,'select a file','','myfile.txt') Returns lErrCode
If len(lPathname)=0
  ; cancel button pressed
  ; file name entered
End If