Using CFLoop with the following code:-
<cfloop index="i" from="1" to="#Ch_Pass_No#">
<cfset Ch_Prod = DateDiff("yyyy", #Form["Ch_DOB" & i]#, LDay)>
<cfset Age_Array[j] = "#DateFormat(Form["Ch_DOB" & i], "dd-mmm-yyyy")#">
<cfset j = j + 1>
<cfif Ch_Prod GT 12>
<cfset #Ad_Num# = #Ad_Num# + 1>
<cfset #Ch_Num# = #Ch_Num# - 1>
<cfset Ad_Change = 1>
<cfset Ch_Change = 1>
<cfelse>
<cfset Transfer_Age_Array[k] = "#Ch_Prod#">
<cfset k = k + 1>
</cfif>
</cfloop>
It has been working fine for a long while - now every so often its starting to throw up a an undefined value (Null Pointer) for the variable #Form["Ch_DOB" & i]#.
Is there anything I can do to improve the code?
Thanks
<cfloop index="i" from="1" to="#Ch_Pass_No#">
<cfset Ch_Prod = DateDiff("yyyy", #Form["Ch_DOB" & i]#, LDay)>
<cfset Age_Array[j] = "#DateFormat(Form["Ch_DOB" & i], "dd-mmm-yyyy")#">
<cfset j = j + 1>
<cfif Ch_Prod GT 12>
<cfset #Ad_Num# = #Ad_Num# + 1>
<cfset #Ch_Num# = #Ch_Num# - 1>
<cfset Ad_Change = 1>
<cfset Ch_Change = 1>
<cfelse>
<cfset Transfer_Age_Array[k] = "#Ch_Prod#">
<cfset k = k + 1>
</cfif>
</cfloop>
It has been working fine for a long while - now every so often its starting to throw up a an undefined value (Null Pointer) for the variable #Form["Ch_DOB" & i]#.
Is there anything I can do to improve the code?
Thanks