Needing the numeric return values for MessageRequester() I was unable to locate them in HELP or online.
( no result for a search in Titles for MessageRequester Return Values or MessageRequester Variables )
Below I list out the return values that someone new to PureB may find helpful.
#PB_MessageRequester_Yes
gives the buttons: [Cancel] [Try Again] [Continue] and the return values 2, 10 & 11
#PB_MessageRequester_YesNoCancel
Gives the buttons : [Yes] [No] [Cancel] and the return values 6,7 & 2
#PB_MessageRequester_YesNo
Gives the buttons: [Yes] [No] and the return values 6 & 7
#PB_MessageRequester_Cancel
Gives the buttons: [Abort] [Retry] [Ignore] and the return values 3, 4 & 5
Button Value
Clicked Returned
~~~~ ~~~~~~
[Cancel] = 2
[Abort ] = 3
[Retry ] = 4
[Ignore] = 5
[Yes ] = 6
[No ] = 7
[Try Again] = 10
[Continue] = 11
MessageRequester Return Values
MessageRequester Return Values
If it's falling over......just remember the computer is never wrong!
Re: MessageRequester Return Values
Here are the valid calls of MessageRequester.
The call from the requester with the flag #PB_MessageRequester_Yes is not valid and leads only randomly to a result.
The call from the requester with the flag #PB_MessageRequester_Yes is not valid and leads only randomly to a result.
Code: Select all
Procedure.s MsgResult(Result)
Protected r1.s
Select Result
Case #PB_MessageRequester_Yes : r1 = "the 'yes' button was pressed"
Case #PB_MessageRequester_No : r1 = "the 'no' button was pressed"
Case #PB_MessageRequester_Cancel : r1 = "the 'Cancel' button was pressed"
Case #IDRETRY : r1 = "the 'retry' button was pressed"
Case #IDABORT : r1 = "the 'abort' button was pressed"
Case #IDIGNORE : r1 = "the 'ignore' button was pressed"
Default
r1 = "the Result " + Result + " button was pressed"
EndSelect
ProcedureReturn r1
EndProcedure
; msg = MessageRequester("Info", "Questions Ok", #PB_MessageRequester_Ok)
; Debug MsgResult(msg)
;
; msg = MessageRequester("Info", "Questions YesNo", #PB_MessageRequester_YesNo)
; Debug MsgResult(msg)
; msg = MessageRequester("Info", "Questions YesNo", #PB_MessageRequester_YesNo)
; Debug MsgResult(msg)
;
; msg = MessageRequester("Info", "Questions YesNoCancel", #PB_MessageRequester_YesNoCancel)
; Debug MsgResult(msg)
; msg = MessageRequester("Info", "Questions YesNoCancel", #PB_MessageRequester_YesNoCancel)
; Debug MsgResult(msg)
; msg = MessageRequester("Info", "Questions YesNoCancel", #PB_MessageRequester_YesNoCancel)
; Debug MsgResult(msg)
; Only Windows
msg = MessageRequester("Info", "Questions RetryCancel", #MB_RETRYCANCEL)
Debug MsgResult(msg)
msg = MessageRequester("Info", "Questions AbortRetryIgnore", #MB_ABORTRETRYIGNORE)
Debug MsgResult(msg)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: MessageRequester Return Values
The call from the requester with the flag #PB_MessageRequester_Yes is not valid and leads only randomly to a result.
- #PB_MessageRequester_Yes
I found to be consistent in its return values in all the tests I made, with Cancel=2, Try Again=10 and Continue=11.
Your comprehensive expansion using PureB variables may well be the preferred syntax but personally I prefer the numeric return variables. Particularly as they are in general, standard and use less code. Additionally, from 2=Cancel through to 7=No, those numbers seem fairly universal in other languages. Probably the [Yes], [No] is the most commonly used and I just find it so easy to just If/EndIf for <Yes>, 6 after the MessageRequester(). Plus it is what I've done for years with Message Prompt Return PopUps, hence my original post.
Last edited by C87 on Wed Feb 13, 2019 10:21 am, edited 1 time in total.
If it's falling over......just remember the computer is never wrong!
Re: MessageRequester Return Values
And since the beginning, there has always been a constant missing for the exclamation point ( ? = 32) but the numerical value works
Code: Select all
MessageRequester("", Str(#PB_MessageRequester_Error), #PB_MessageRequester_Error)
MessageRequester("", "The 32 is missing. (The question mark) but numeric value works", 32)
MessageRequester("", Str(#PB_MessageRequester_Warning), #PB_MessageRequester_Warning)
MessageRequester("", Str(#PB_MessageRequester_Info), #PB_MessageRequester_Info)
MessageRequester("", "No icon for ?", #PB_MessageRequester_YesNo)
-
- Enthusiast
- Posts: 429
- Joined: Sun Apr 06, 2008 12:54 pm
- Location: Brisbane, Qld, Australia
- Contact:
Re: MessageRequester Return Values
For question mark (?) you can use the constant #MB_ICONQUESTION.
Re: MessageRequester Return Values
Are your values also standard in Linux and OSXC87 wrote:... PureB variables may well be the preferred syntax but personally I prefer the numeric return variables. Particularly as they are in general, standard and use less code. Additionally, from 2=Cancel through to 7=No, those numbers seem fairly universal in other languages.
Using PB constants is always the better way.
Re: MessageRequester Return Values
This also applies to Windows constants declared in PB. It can also change sometimes something and then you look for a wolf to find the error.
Except that the code doesn't get bigger when using constants, but only the code will read better than just any numbers.
That's what constants are meant for...
But everyone should do as he wants
Except that the code doesn't get bigger when using constants, but only the code will read better than just any numbers.
That's what constants are meant for...
But everyone should do as he wants
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: MessageRequester Return Values
Ah, infratec got me there!.....I'm a Microsoft only guy, since 1983 actually.From MS-DOS to Windows with some CP/M & MP/M along the way.infratec asked:Are your values also standard in Linux and OSX
Once tried Linux Mint but unimpressed & never owned, or even used an Apple computer or phone.
If it's falling over......just remember the computer is never wrong!