2.14.1.4 dlgSave

Brief Information

Open the Save As dialog

Additional Information

X-Function not designed for Auto GetN Dialog. That is, the following cannot be used:

DlgSave -d

Command Line Usage

1. dlgSave; // save the file name to string fname$

2. dlgSave fname:=myfile; // save the file name to myfile$

3. dlgSave ext:=*.ogs title:="Saving GIF file location"; // Initialize the dialog with file extension ogs and title "Saving GIF file location".

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
fname

Output

string

fname$

The string that will receive path and name of the user's chosen file.

file extension ext

Input

string

*.*

Optional string used to initialize the dialog with settings from a file extension group.

init

Input

string

User Files

Optional string used to initialize the file path (for opening, saving, etc.) in the dialog.

Save as dialog title title

Input

string

Optional string used to set the dialog's title.

Description

This X-Function opens a dialog asking user to "create" a file. When the file name and path is specified, the full path file name is saved to a variable. And the file is not saved.

Examples

This example finds and imports files satisfied certain condition, and then create a video based graphs of these data.

doc -s; 
doc -n;
string fname$;//all the XF that deals with files default to fname$ string
//Find files and import them
findFiles path:=system.path.program$+"Samples\Curve Fitting" ext:="*.dat" addpath:=1;//result in fname$
//import from fname$, ImpMode=3 for new book
impasc option.sparklines:=0 option.ImpMode:=3 Options.Names.FNameToBk:=0;
//Create graphs with only the 1st 2 columns
doc -e W
{
	plotxy iy:=(1,2) plot:=200; window -ia;
}
//Specify the path and name of the video file.
dlgSave ext:=*.avi title:="Saving Video file location";
//Make video
int err = vw.Create(%(fname$));
if(err!= 0)
{
	err=;
	break 1;
}
doc -e P
{
	vw.WriteGraph(%H,1)
}
vw.Release();
type -a "File saved to %(fname$)";

Related X-Functions

findFiles