mdlDialog_fileOpen(), mdlDialog_fileCreate() and the like return an integer to indicate what the user clicked. When MDL had a BoolInt #defined, this three-state result made some sort of sense:
TRUE if the CANCEL button is pressed, FALSE if the OK button is pressed, and ERROR if an error occurred while the Dialog Box was being created.
These days, those functions return an int. This MicroStationAPI documentation comment makes less sense, at least to those of us who consider bool to have only two values...
true if the CANCEL button is pressed, false if the OK button is pressed, and ERROR if an error occurred while the Dialog Box was being created.
I make this point because the following code snippets may work differently, depending on how the C++ compiler interprets the integer values of true and ERROR...
// Order false, true, ERROR int result = mdlDialog_fileSomething (); switch (result) { case false: //OK break; case true: break; case ERROR: break; }
// Order false, ERROR, true int result = mdlDialog_fileSomething (); switch (result) { case false: //OK break; case ERROR: break; case true: break; }
If user cancels the file open/close dialog, or an error occurs while creating the dialog, what line in the switch
statement is reached?