/newif clarification

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

/newif clarification

Post by LordGiddion » Tue Apr 20, 2004 9:23 pm

It was my understanding that any non-zero result should eval as true by /newif is this correct?
This /newif fails with "Failed to parse Newif condition 'duck', non-numeric encountered.
/newif (${String[@MyVar].Arg[1]}) {
/echo "Check Value"
}else{
/echo "no value at position 1"
}

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

Post by ml2517 » Tue Apr 20, 2004 10:06 pm

Try:

Code: Select all

/newif (${String[@MyVar].Arg[1].Length}>0) { 
/echo "Check Value" 
} else { 
/echo "no value at position 1" 
} 
Or

Code: Select all

/newif (${String[@MyVar].Arg[1].NotEqual[NULL]}) { 
/echo "Check Value" 
} else { 
/echo "no value at position 1" 
} 
Any non-zero *number* results in true.

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Tue Apr 20, 2004 10:10 pm

Right ml2517 I used the length tech. but in the /new description the statement was all non-zero is true. I was trying to check if it was functioning as designed.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 21, 2004 12:15 am

"non-numeric encountered" should be an indication that it cannot parse "duck" ;)

It's functioning as intended.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0