|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
help with lists
i have the following lists
cdr1 = "1,2,3" cdr2 = "1,4" cdr3 = "1,22,434, 54, 23" i am doing an insert and trying to check for the existence of each element in the list with: IsDefined(ListGetAt(FORM['spotLength' & i], j)) where i is the index of cdr and j is the element position when it comes to cdr1, element number 4, the ListGetAt function fails since there is no element at position number 4. how can i bypass that so if there is no element it will insert only NULL thanks for the help in advance |
|
#2
|
||||
|
||||
|
The problem is that ListGetAt will try to run and then fail in your script whether or not the index is there.
Try doing something like this: Code:
<cfif ListLen(FORM['spotLength' & i]) GTE j> #ListGetAt(FORM['spotLength' & i],j)# <cfelse> NULL </cfif> Hope that helps. |
|
#3
|
|||
|
|||
|
funny, i tried before you posted. i found a better solution. instead of setting cdr1 = "1,2,3"
i use cdr1 = 1, cdr2 = 2, cdr3 = 3 ![]() thanks for the response... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > help with lists |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|