Nope, have to use CFTRY..CFCATCH to do it.  Rather a PITA, but such is life.

Two potential alternatives:

1) don't use an array, use a struct.  This works well if you don't
have to fill in the gaps.
2) prepopulate the entire array with 'blanks', and the overwrite the
indexes that have real values.  This only works if you know how large
the array is in advance.

cheers,
barneyb

On Tue, 9 Nov 2004 18:52:28 -0500, Tyler <[EMAIL PROTECTED]> wrote:
> Is there anyway to check if an array's value is defined without using a
> try/catch statement?
> 
> I'm creating a calendar array for a good amount of years, and it's killing
> my processing time to wrap a cftry around each and every call after adding
> just a couple array elements (which then creates all the other un-defined
> elements "below" the current element.)
> 
> IsDefined(), or probably #IsDefined("myArray[" & somevar & "][" & i & "]")#,
> isn't working either.  I can tell that myArray[somevar] exists and is an
> array, but when "i" is pointing to an undefined array element, I can't tell
> without throwing an error...argghhh.
> 
> Tyler
> 
> 
-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/blog/

I currently have 0 GMail invites for the taking

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183820
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to