Gary's suggestion is the safest way i.e. initialize up to the highest
possible number of elements.

You could also nest the CFIF conditions individually 

i.e.

<cfif IsDefined(nswArray[37])>
     <cfif nswArray[37] NEQ "">
        #nswArray[37]#
     </cfif>
</cfif>
 

> Hi People,
> 
> I have an array that is dynamically populated.
> 
> Some times there's up to 44 elements in it, others only 36.
> 
> I'm stuct determining when an element doesn't exist, and then not to try and
> output it.
> 
> I've tried
> <cfif IsDefined(nswArray[37]) AND nswArray[37] NEQ "">
>     #nswArray[37]#
> </cfif>
> 
> That failed
> 
> Suggestions please, the brain will not go into gear this morning.
> 
> petcol

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to