SAS Component Language Dictionary |
Category: | External File |
Syntax | |
Details | |
Examples | |
See Also |
Syntax |
rc=FILEDIALOG(dialog-type,filename<,default-file <,default-dir<,filter-1<. . . ,filter-11<,description-1 . . .<description-11>>>>>>); |
contains the return code for the operation:
specifies the type of dialog window to open. An invalid type specification produces an error and halts the program. Types are
is the fully qualified name of the selected file, including the directory.
Note: This parameter is an update parameter. See Input, Output, and Update Parameters for more information.
is the name of the file (without directory information) to display as selected when the dialog window opens. If you specify a null string (''), the file that was selected last is the default file.
is the directory whose files are listed when the dialog window opens. If you specify a null string (''), the directory that was selected last is the default directory.
are up to 11 name specifications to narrow the list of files to display -- for example, *.html. The number of filter arguments is host specific. If you do not supply a filter, the list contains all files in default-dir.
are up to 11 descriptions, one for each filter, to make the dialog window more informative for application users. If no descriptions are supplied, a default description is displayed for each specified filter. If you provide a description for any filter, then you must supply a description for each filter that you specify.
Details |
Depending on the values of default-dir and filter, default-file may not be in the list of files displayed. Therefore, default-file will not be selected.
An error condition is produced if you supply a description for at least one filter but fail to supply a description for each specified filter.
Operating Environment Information: The formats of the files and filter parameters are all host specific. The UNIX and Microsoft Windows platforms use all of the passed filters. The Macintosh platform ignores the filter argument. All other platforms use only the first filter that is passed.
Examples |
Enable a user to select a file to open, and see whether the user canceled the window:
rc=filedialog('saveas',selfile,'autoexec.sas', '/sas','*.sas'); /* Process the selected file */ select(rc); when(0) put 'New file selected'; when(1) put 'REPLACE an existing file'; when(2) put 'APPEND to an existing file'; when(-1) put 'User pressed cancel'; otherwise put 'ERROR occurred'; end;
Display a list of filenames that have .SAS, .HTML, and .GIF extensions, and provide descriptions for these filters:
rc=filedialog('open',selfile,'','', '*.sas','*.html','*.gif','','','','','','','','', 'SAS Files','Web Pages','Images');
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.