> I'm trying to use an array, can anyone tell me what's wrong with the
> syntax below please?
>
> <CFIF IsDefined("form.Astockid[1][#i#]") AND form.Astockid[1][#i#] NEQ
> "" AND IsDefined("form.Aquantity[2][#i#]") AND form.Aquantity[2][#i#] GT
> 0>

You can't use IsDefined to test for the existence of an array element. You
can use it to test for the existence of the array itself, but that's it. If
you were careful to ensure that your array elements are contiguous, you can
simply check to see if i is less than or equal to
ArrayLen(Form.aStockID[1]). If you weren't careful, then your only choice is
to try to reference the potential array element, then catch the exception
that occurs when it doesn't exist.

Dave Watts, CTO, Fig Leaf Software 
http://www.figleaf.com/ 

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information! 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250114
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to