Code: Select all
Procedure.b mb(cap.s,msg.s,flag.b,icon.b)
Select flag
Case 1 : flag = #MB_OKCANCEL
Case 2 : flag = #MB_ABORTRETRYIGNORE
Case 3 : flag = #MB_YESNOCANCEL
Case 4 : flag = #MB_YESNO
; Case 5 : flag = #MB_RETRYCANCEL
; Case 6 : flag = #MB_CANCELTRYCONTINUE
Default : flag = #MB_OK
EndSelect
Select icon
Case 1 : icon = #MB_ICONEXCLAMATION
Case 2 : icon = #MB_ICONQUESTION
Case 3 : icon = #MB_ICONSTOP
Default : icon = #MB_ICONINFORMATION
EndSelect
ProcedureReturn MessageRequester(cap,msg+" ",flag|icon)
EndProcedure
A good way to manage Warning messages is a Select/Case procedure like this:
Code: Select all
Procedure.l Warning(n.b)
typ.b = 0 : icon.b = 0
Select n
Case 101
cap$ = "- Warning! -" : typ = 4 : icon = 1
Msg$ = "Do you want to QUIT without saving? "
Case 102
cap$ = "- Sorry! -" : typ = 0 : icon = 3
Msg$ = "The file could not be opened! "
EndSelect
ProcedureReturn mb(cap$,Msg$,typ,icon)
EndProcedure
Hope this helps someone