If Loops have and statement ?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

c52k
decaying skeleton
decaying skeleton
Posts: 6
Joined: Fri Feb 27, 2004 10:48 pm

If Loops have and statement ?

Post by c52k » Thu Mar 04, 2004 4:02 am

So i looked through the manual numerous times and tried searching the forums with no luck.

I'm trying to find the syntax if it does exist for if/and statements.

I'm trying to do some pretty simple comparissons like

if yourloc(x)>10 && myloc(x)<100 /call mysub

Is the && operation available in MQ ? I haven't seen any code that uses it but that's not to say it doesn't exist. I'm only a few weeks old in to MQ :)

Thanks for any help you can provide.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Mar 04, 2004 4:19 am

Don't mind me.. I'm running off to poke my fu$*ing eyes out. Open your eyes, I've answered and re-answered and re-answered this question.
Last edited by ml2517 on Thu Mar 04, 2004 9:23 am, edited 1 time in total.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: If Loops have and statement ?

Post by wassup » Thu Mar 04, 2004 6:46 am

c52k wrote:So i looked through the manual numerous times and tried searching the forums with no luck.

I'm trying to find the syntax if it does exist for if/and statements.

I'm trying to do some pretty simple comparissons like

if yourloc(x)>10 && myloc(x)<100 /call mysub

Is the && operation available in MQ ? I haven't seen any code that uses it but that's not to say it doesn't exist. I'm only a few weeks old in to MQ :)

Thanks for any help you can provide.
Click this link: http://macroquest2.com/phpBB2/search.php

c52k
decaying skeleton
decaying skeleton
Posts: 6
Joined: Fri Feb 27, 2004 10:48 pm

Post by c52k » Thu Mar 04, 2004 6:06 pm

/sigh

well my eyes are open and unfortunately cannot find anything that talks about the && operation in If loops.

The manual doesn't show an example, just If / else statements. Sure i could accomplish what i want by just nesting If loops but i was just curious if i could use the && operation since MQ seemed to barf when I used the syntax the way i would in other languages.

I know how to use the If loop, have no problem with it at all, just can't seem to get the syntax for an && statement and wanted to know if it existed and what the proper syntax was.

So in sum, i did read through the manual, numerous times and did search the forums and also looked through the macro depot at existing code to see if anyone was using it. Unfortunately no luck, so i decided to post my question here so i can waste your time to flame me and my time to read it.

But i guess it's just easier to show your bravado than to simply say, yes it's implemented, maybe you're not searching for the right keywords but here's a link to one of my answers to this question.

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Thu Mar 04, 2004 6:09 pm

Try double pipes.
-Elric

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Mar 04, 2004 6:12 pm

c52k wrote:/sigh

well my eyes are open and unfortunately cannot find anything that talks about the && operation in If loops.

The manual doesn't show an example, just If / else statements. Sure i could accomplish what i want by just nesting If loops but i was just curious if i could use the && operation since MQ seemed to barf when I used the syntax the way i would in other languages.

I know how to use the If loop, have no problem with it at all, just can't seem to get the syntax for an && statement and wanted to know if it existed and what the proper syntax was.

So in sum, i did read through the manual, numerous times and did search the forums and also looked through the macro depot at existing code to see if anyone was using it. Unfortunately no luck, so i decided to post my question here so i can waste your time to flame me and my time to read it.

But i guess it's just easier to show your bravado than to simply say, yes it's implemented, maybe you're not searching for the right keywords but here's a link to one of my answers to this question.
No people get sick of answering the same freaking questions over and over and over. If you'd looked down about 20 posts in this forum you woul d see a post entitled:

"is there any way to use && or || (and & or) operators"

c52k
decaying skeleton
decaying skeleton
Posts: 6
Joined: Fri Feb 27, 2004 10:48 pm

Post by c52k » Thu Mar 04, 2004 6:44 pm

Thank you, that was what i needed.

I understand it gets old answering the same question over and over again but not everyone is lazy and trying to get you to do all their work for them. I've been struggling with this for the past few days and finally gave in made that post.

Anyhow, no point rambling on. Thanks for the pointer. I found the post you were talking about.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Fri Mar 05, 2004 3:20 am

c52k wrote:/sigh

well my eyes are open and unfortunately cannot find anything that talks about the && operation in If loops.

The manual doesn't show an example, just If / else statements. Sure i could accomplish what i want by just nesting If loops but i was just curious if i could use the && operation since MQ seemed to barf when I used the syntax the way i would in other languages.

I know how to use the If loop, have no problem with it at all, just can't seem to get the syntax for an && statement and wanted to know if it existed and what the proper syntax was.

So in sum, i did read through the manual, numerous times and did search the forums and also looked through the macro depot at existing code to see if anyone was using it. Unfortunately no luck, so i decided to post my question here so i can waste your time to flame me and my time to read it.

But i guess it's just easier to show your bravado than to simply say, yes it's implemented, maybe you're not searching for the right keywords but here's a link to one of my answers to this question.
BTW, I am going to add in examples of this in the next readme. It's something that should be there IMO.

I'd really like it if people would PM me suggestions/info about the functions if it reads strange or needs corrections. It's quite large.