GetFileSave


The GetFileSave function uses the Windows Save dialog to browse for a file name string. If the [Save] button is clicked, the full path name of the file is returned. This function does not actually save the file.

Syntax

sName = GetFileSave( tblParams )

sName = GetFileSave()

bullet.gif    tblParams is an optional table containing values from the FileNameParams table. If omitted, default FileNameParams values are used.

bullet.gif    If the [Save] button is clicked, the full file path is returned as sName.

bullet.gif    If the dialog was closed using [Cancel] or [X], nil is returned.

Examples

The scripts below show the use of GetFileSave with and without overriding the FileNameParams values.

sName = GetFileSave()

-- use the default GetFileSave dialog

if sName then Printf("name=%s\n",sName) end

-- exit the script if sName is nil

 

 

Params =

-- setup a table with FileNameParams overrides

{

-- (use a comma after each value)

  sSaveTitle = "Save the Source File",

-- the new title for the Save dialog

}

 

str = GetFileSave(Params)

-- use GetFileSave with new properties

 

 

Params =

-- setup a FileNameParams table

{

-- (use a comma after each value)

  sSaveTitle = "Save the Source File",

-- the new title for the Save dialog

}

 

str, NewParams = GetFileSave(Params)

-- use GetFileSave and use the returned properties

if str ~= nil then

-- check that valid results are returned

  Printf("Ext=%s\n", NewParams.sFileExt)

-- list the new file extension

end

 

Related Topics

Dialog Functions

Directory Functions

GetFileOpen

FileNameParams

new_fileopen

GetString

SetFlipFITS

GetFolder

 


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.