Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ArrayIsDefined

Explorer ,
Jun 11, 2012 Jun 11, 2012

This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ed3.html

440
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2012 Jun 11, 2012

This function is buggy. If the index you're testing is larger than the array's length, the it throws an error instead of returning false, as in "no, that index doesn't exists". A work-around would be:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2012 Jun 11, 2012
LATEST

Did you see the bit in the very document you are commenting on that says this: "The index value of an element must be less than the length of the array."?

Whilst I agree the implementation of this function is ill-thought-out, it does do what it says on the wrapper.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources