BROWSE
BROWSE displays a window that prompts the user to select or enter a file name and populates a string variable with the chosen file path.
Syntax: BROWSE "prompt", variable, mode BROWSE "prompt", variable, mode, "extension"
Discussion:
The variable may be any valid string variable name. The mode argument is an integer that can be either 0 for 'load mode' which prompts the user for an existing file or 1 for 'save mode' which prompts the user for a file name to save as. The string "extension" provides the option to filter the files shown by the designated extension (e.g. ".CFG").
Note that the BROWSE function is meant to allow the user to select a file and populate a string variable with the file path and will not automatically open or save files.
Example:
! Load BROWSE "File:",A$,0,".txt" OPEN A$ PRINT "Reading file:" PRINT A$ READ x READ y READ z CLOSE ! Save BROWSE "Save Merit Function as: ",B$,1,".mf" SAVEMERIT B$ PRINT "Saving file as: ",B$
Related keywords:
INPUT
Next: