Maplets[Utilities] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Maplets : Utilities : Maplets/Utilities/GetFile

Maplets[Utilities]

  

GetFile

  

flexible file selection dialog utility

 

Calling Sequence

Parameters

Description

Options

Examples

Calling Sequence

GetFile(opts)

GetFile[refID](opts)

Parameters

opts

-

equation(s) of the form option=value; where option is one of approvecaption, approvecheck, directory, filefilter, filename, filterdescription, height, reference, resizable, title, or width; specify options for the Maplet application

refID

-

name or string; reference to the element

Description

• 

The GetFile(opts) calling sequence displays a file dialog that allows the user to choose a file. The value returned is the string corresponding to the chosen file. If a file is not selected, NULL is returned.

• 

This is a front-end to the FileDialog command. As such, leading and trailing spaces in filenames are automatically removed when a file is selected, and quoted filenames are also handled correctly.

• 

Optionally, the GetFile utility validates the existence of a file.

Options

• 

The opts argument can contain one or more of the following equations that set Maplet application options.

  

 

  

approvecaption = string or symbol

  

The text that appears on the button that is clicked to select the file. By default, the value is Open.

  

 

  

approvecheck = true or false

  

Indicates whether the existence of the file should be checked before exiting the Maplet application. By default, the value is true. If this is set to true, and the file is not present, an error dialog indicating this is displayed, and the Maplet application does not exit until a file is correctly chosen or the 'Cancel' button is pressed.

  

 

  

directory = string or symbol

  

Initial directory in which the file dialog opens.

  

 

  

filefilter = string or symbol

  

The extension of the files that display.  By default, the value is "*", that is, all files are shown. It can also be used with other extensions, for example, "mws", "m", or "mpl".

  

 

  

filename = string or symbol

  

Initial filename when the file dialog opens. By default this is null.

  

 

  

filterdescription = string or symbol

  

A description of the filefilter. By default, this is all files.

  

 

  

height = posint

  

The height of the file dialog in pixels.

  

 

  

resizable = true or false

  

Whether the file dialog is resizable. By default this is true.

  

 

  

reference = name or string

  

A reference for the GetFile element.

  

If the reference is specified by both an index, for example, GetFile[refID], and in the calling sequence, an error results.

  

 

  

title = string or symbol

  

Specifies the Maplet application title.  By default, the title is Get File.

  

 

  

width = posint

  

The width of the file dialog in pixels.

Examples

A file open dialog that checks for the existence of a file before exiting.

withMaplets[Utilities]:

GetFile'title'=Open Maple Worksheet,'directory'=/user/maple,'filefilter'=mws,'filterdescription'=Maple Worksheets

/user/maple/example.mws

(1)

See Also

Maplets[Elements]

Maplets[Elements][FileDialog]

Maplets[Examples][GetFile]

Maplets[Utilities]

Overview of Maplet Applications

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam