Skip to content

IDL Problem Code 105 with alias illegal-var-index

Want to disable me? Check out the configuration guide to learn more.

Pro Tip

This is not a real error in IDL, but rather comes from a legacy method to access elements from arrays.

For all users new to IDL, please use brackets to index variables. Using parentheses is confusing to read and a practice that is no longer the norm when writing PRO code

In fact, if you use format on save and have problem fixing enabled, this will be corrected for you automatically so that you don't need to make any code changes yourself!

This identifies when you use parentheses to index variables instead of brackets.

idl
a = make_array(42)

b = a(0)
   ; ^^ should be using brackets

To correct, use brackets instead and add compile_opt idl2 to the routine:

idl
compile_opt idl2
a = make_array(42)

b = a[0]

Licensed under MIT.