Skip to content

IDL Problem Code 38 with alias no-comp-opt

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

Best Practice

For modern IDL programming, compile_opt idl2 is a must to help prevent common mistakes and normalize how people should write their IDL code.

Some compile_opt errors are automatically fixed on save (when configured).

Each routine and main level program should have a compile_opt idl2 statement present to control how IDL interprets default numbers and array indexing.

Adding compile_opt idl2 is a long-standing best practice and IDL for VSCode has automation to fix this problem on file save so you don't have to add this to every routine.

Here's an example of how to reproduce the error:

idl
pro myPro
; ^^^^^^^ missing compile_opt idl2
  ; ... logic

end

Which you can fix by adding in compile_opt:

idl
pro myPro
  compile_opt idl2

  ; ... logic

end

Licensed under MIT.