Page 1 of 1
${String[].Equal[]}
Posted: Sat May 01, 2004 8:07 am
by Vexix
/echo ${String[].Equal[]}
gives NULL, and it should return TRUE.
--Vexix
Posted: Sat May 01, 2004 9:59 am
by ml2517
Acutally I think the way it works is that the first item is NULL and therefore it gives up. Its working as intended.
Ahright.
Posted: Sat May 01, 2004 10:32 am
by Vexix
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
Posted: Sat May 01, 2004 10:35 am
by ml2517
Yeah good point. I will probably start doing the same thing for my string variables. The other should default to 0 I believe.
Posted: Sat May 01, 2004 3:13 pm
by Lax
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.