|
|
#1 |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
Question about Message Boxes
Howdy folks! Brand new here...
![]() I am wondering if there is an alternative to being forced to use gotos and labels as the result of buttons in a message box. Instead of using labels I would like to set some flags or something similar. I have been a developer for many years and the thought of using gotos makes me cringe a little bit haha! I am using a MB_YESNOCANCEL message box and once the flags are set I would do some logic on them via LogicLib.nsh. Thanks for any info! |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
Try reading the manual and the example scripts supplied with NSIS.
Here is a simple example to get you started: PHP Code:
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
Thanks for the info! My apologies, I did look through the manual (but not example scripts) and every mention I could find of MessageBox used labels. I must have missed the part where they work with logical flow statements. I had also googled for hours trying to find this information too so I hope you don't think I was lazy haha
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
I also need this to work with YESNOCANCEL (so 3 buttons), off to searching the manual again and examples I go! Thanks again for pointing me in the right direction.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
How about something like this?
PHP Code:
|
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
I find "Windows Grep" useful for searching the example files supplied with NSIS.
|
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
Quote:
I also grepped for instances of ${If} and ${Cmd} together to see if they were possibly used with another command other than messagebox, no dice. I am not lazy, I know how to search for stuff. This isn't my first rodeo =( I may have seen what I needed and not known it was what I needed. Sorry for the troubles
|
|
|
|
|
|
|
#8 | |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
Quote:
Have you bothered to look at the LogicLib.nsi example script? It shows that LogicLib uses ${ElseIf} for the "if ... elseif ... else ... endif" structure. The ${If} ${Cmd} structure conditionally executes an inline statement, depending on a true value of the provided NSIS function. Your suggestion uses `IDNO` which is not a function. |
|
|
|
|
|
|
#9 | |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
Quote:
My question was never about how to setup the logic structure, I know how to use ${ElseIf} just fine (in general that is). My question is how to use that logic structure specifically with MessageBox YESNOCANCEL. There are only 2 examples in LogicLib.nsi that reference MessageBox. PHP Code:
PHP Code:
The only example in that script that references ${ElseIf} is the below, and it is just using strings, nothing to do with commands like MessageBox. PHP Code:
|
|
|
|
|
|
|
#10 | |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
Quote:
${ElseIf} ${Cmd} `IDNO` (which still won't work obviously) Please excuse the slip of the keyboard, I know how to use ${ElseIf}, this isn't my first NSIS script
|
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Mar 2011
Posts: 8
|
For simplicity, this is exactly what I am trying to figure out... (I can ramble some)
Reference the [WHAT GOES HERE] PHP Code:
|
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
You have to use labels I'm afraid, unless you use nsL (see sticky topic).
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|