isDefined and syntactically correct variable name

i am trying to validate the existance of a dynamicaly named variable but i am getting an error when i check it

Parameter 1 of function IsDefined which is now "arrTracking[idx+1]['en']" must be a syntactically valid variable name

suggestions on how i can fix this?

LVL 25
James RodgersWeb Applications DeveloperAsked:
Who is Participating?


It looks like you're testing for the existance of a structure element, not a variable.

<cfif structKeyExists(arrTracking[idx+1], langIdx)>

will test to see if langIdx is a key at that array location

<cfif (idx+1) le arrayLen(arrTracking)  and  structKeyExists(arrTracking[idx+1], langIdx)>

This will test the array location and then the struct key at that location

James RodgersWeb Applications DeveloperAuthor Commented:
iv solved teh processing issue by using a try-catch, but i would stil,like to know if i can use isDefined in some way

James RodgersWeb Applications DeveloperAuthor Commented:
thanks works perfectly!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.