| |||
| Home > RealView Debugger Predefined Macros > Alphabetical predefined macro reference > prompt_file | |||
Displays an Open File dialog.
This macro is not available in the headless debugger.
int prompt_file(title, buff)
char *title;
char *buff;
where:
titleThe text that appears in the title bar of the Open File dialog.
buffThe filename that appears in the File name text box of the dialog. Assign an empty string to leave the File name text box blank.
Contains the chosen path and filename of the opened file when the Open button is clicked.
This macro displays an Open File dialog.
Assign an empty string to buff to leave the
File name text box of the dialog blank.
Assign a filename, without a path, to buff before
executing this macro, the filename appears in the File name text
box of the dialog.
When you click Open, buff contains
the chosen path and filename.
This example shows how to use prompt_file in
a macro:
define /R void openFile()
{
char filename[100];
int retval;
retval = prompt_file("Open File", filename);
if (retval == 1)
$printf "Open file cancelled!\n"$;
else
retval = fopen(100,filename,”r”); if (retval < 0)
$printf "Could not open file: %s\n", filename$;
else
$printf "Opened file: %s\n", filename$;
}
.
The following macros provide similar or related functionality:
prompt_list on prompt_list
prompt_text on prompt_text
prompt_yesno on prompt_yesno
prompt_yesnocancel on prompt_yesno_cancel.