我对IDL不太熟悉,但我正在尝试运行一位同事给我的代码。我在通用代码片段genrand2d.pro(从here下载)中得到了奇怪的语法错误,这阻止了整个事情的运行。可能它的版本语法改变了,因为我的同事有IDL版本6.3而我有8.6.0(在Scientific Linux 7.2上),但我还没有找到一个列表语法更改或类似于检查。
导致问题的一行是:
randx = arrscl(randomu(seed, nbad, /double), $
minx, maxx, $
arrmin=0d, arrmax=1d )
错误信息:
arrmin=0d, arrmax=1d )
^
% Syntax error.
At: /generic/path/genrand2d.pro, Line 114
答案 0 :(得分:0)
My guess is that IDL is confused on whether arrscl
is an array or a function. To test if this is the case, compile arrscl
, recompile genrand2d
, and then try again.
In general, to fix these errors use compile_opt strictarr
in all your routines and always use square brackets for array indexing.