Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The "!"
#1
Ok...I understand in QM the "!" is used as not equal...ie

Code:
Copy      Help
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
#2
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
#3
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!
#4
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)