"Save As" dialog

Use GetSaveFileName$ function defined in \Library\FileName.LIB to show "Save As" dialog and get a file name.

Example.

100 DECLARE EXTERNAL FUNCTION GetSaveFileName$ 
110 PRINT GetSaveFileName$("CSV file","CSV","")
120 END
130 MERGE "FILENAME.LIB"

The 100 line is a declaration to use an indetifier GetSaveFileName$ as an external function name.
MERGE statement in 130 line demands FILENAME.LIB to be appended on compiling.
The parameters of GetSaveFileName$ are the explanation text for the file type, default extension, initial directory in sequence.
A default extension must be within three characters. a period should be omitted.

GetSaveFileName$ function is defined using Win32API
You can inspect the definition of it in the file FILENAME.LIB located in the LIB folder.
Note. When you made a original library, put it into the UserLib folder, where MERGE statement searches in higher priority than Library folder.


"Yes" "No" dialog

YesNoBox$ function shows a "yes" "No" dialog to get the choice. The result of it is either "Y" or "N".

Example.

10 DECLARE EXTERNAL FUNCTION YesNoBox$ 
20 SELECT CASE YesNoBox$("Execute ?")
30 CASE "Y"
40   PRINT "start to execute"
50 CASE "N"
60   PRINT "cancel the execution"
70 END SELECT
80 END
90 MERGE "MSGBOX.LIB"


In MSGBOX.LIB, AbortRetryBox$ function, which shows "Abort", "Retry" and "Ignore", is defined, too.
As these function are defined using Win32API MessageBox, we can modify them for our purposes.


Back