Posts: 1,000
Threads: 253
Joined: Feb 2008
Ok...I understand in QM the "!" is used as not equal...ie
str Test
Test="On"
if(Test!"Off")
,out "On"
,
;outputs "On"
But I see it all over the place in QM and don't quite get the syntax all the time. Could I get some examples of different ways the "!" is used and explanations of what is going on in each case.
Thanks,
Jimmy Vig
Posts: 12,071
Threads: 140
Joined: Dec 2002
if(a!b) ;;if a is not equal b
if(!a) ;;if a is 0
a and b can be variables or functions or other expressions. For example
if(!somefunction(1 2 3)) ;;if somefunction returns 0
More examples:
if(a) ;;if a is not 0
if(somefunction(1 2 3)) ;;if somefunction returns not 0
Posts: 1,000
Threads: 253
Joined: Feb 2008
Ok...so this right here for the ShowDialog:
if(!ShowDialog("Drinks" &Drinks &controls)) ret
This is saying what exactly?
Being that this works to call:
ShowDialog("Drinks" &Drinks &controls)
Why use the "if" and "ret".
When would ShowDialog be Zero?
Sorry to be such a question-bug about this; it seems pretty useful and important, but why or how I haven't got a clue.
I haven't written anything that seems to need this, but it there are a lot of codes I don't really understand that use this and I feel like I am missing out on something.
Thanks Quite a Lot for your help!
Posts: 12,071
Threads: 140
Joined: Dec 2002
Error in my prev post. Now fixed.
On Cancel, ShowDialog returns 0, and then the macro returns (ret). On OK, ShowDialog returns 1 and then the macro continues.