Contents Previous Next Subchapters

Opening A File Using The System Browser Dialog
Syntax openfile
openfile(
caption)
openfile(
captionname)
openfile(
captionnamedescriptionextension)
See Also savefile

Description
Creates a system file browser dialog, in which the user can select a file to open, and returns a character row vector containing the file name selected by the user. If specified, the following character row vectors affect the state of the file browser: caption is the caption to be used for the file browser; name is the default file name; description and extension are the default description and file extension in the dialog. The default file extension must be between 3 and 5 characters and must begin with the characters "*.". Trailing space characters are ignored in all the arguments to openfile.

If the user chooses a valid file name, the return value of openfile is a character row vector containing the name of the file. Otherwise, the return value is an empty character row vector; that is, it has column dimension equal to 0.

Example
If you enter
     caption     = "Example: openfile"
     name        = "autoexec.oms"
     description = "O-Matrix Files"
     extension   = "*.oms"
     openfile(caption, name, description, extension)
O-Matrix will display a system browser dialog. If you choose a file in the dialog, O-Matrix will print the name of the file in the command window.