${String[].Equal[]}

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

${String[].Equal[]}

Post by Vexix » Sat May 01, 2004 8:07 am

/echo ${String[].Equal[]}

gives NULL, and it should return TRUE.

--Vexix

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

Post by ml2517 » Sat May 01, 2004 9:59 am

Acutally I think the way it works is that the first item is NULL and therefore it gives up. Its working as intended.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Ahright.

Post by Vexix » Sat May 01, 2004 10:32 am

Gotcha. A good reason to use the assign default values for arrays then. I noticed that the value of an undefined element in an array was "", and was trying to check to see if that element in the array was defined by looking at /if (${array[1].Equal[]}) /betterdefinethatelement

Will use the /declare array[10] global NOT_DEFINED default instead.

--Vexix

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

Post by ml2517 » Sat May 01, 2004 10:35 am

Yeah good point. I will probably start doing the same thing for my string variables. The other should default to 0 I believe.

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 » Sat May 01, 2004 3:13 pm

Here's a trick:

Code: Select all

/if (${MyString.Length}) {
/echo string has content
} else {
/echo string does not exist or is empty
}
Kind of like checking ${Spawn[1].ID} to see if a spawn exists.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0