thanks, but I need it for a *dynamic* var.. and that was the hard part for me.
Fang & savvykms,
those work great, thank you!
I was not sure how to implement an array for this problem because I do not know in advance the dynamic number part of the dynamic var. Server-side code generates a list and I need one dynamic var per item in the list... but it is only the client at runtime who will know how many items should go into that array. Maybe you are saying I should just look to see if the item exists in the array.. but I ended up not trying to go that route since the other posts here solved the issue.
To find the total number of items in an array use ArrayVar.length(). Usually that is a much cleaner way to go rather than testing to see if a series of variables exist that all end with a numeric value (especially true if the numbers are sequential).
that makes sense.. but in this case the question would not be how many items are in the array, but IF the dynamic var had been initialized yet. I was not initializing them onLoad.. I was only initializing upon the first time the user clicked an anchor.. so all the vars were un-initialized at first.. I needed a way to test whether the anchor in question had been clicked yet.. (because after they clicked the anchor then from then on the var was initialized.)
I noticed an array could probably be used for this. The question was about dynamicly created variables through eval() statements, rather than arrays. As far as linking a server-side list/array into a client-side script, try generating the script via PHP or another server-side langauge or CGI setup.