Fishbones78
Fishbones78

Reputation: 61

IDL Function Is Reluctant To Define

Happy Monday Everyone!

So. I'm really, really new to IDL. I need to translate a program I have written in Python to IDL, and I can barely get it started.

I am trying to define a function, but I am given the following error each time I try to compile it.

% Compiled module: OSTN02.
% Compiled module: OSTN02.
% Attempt to call undefined procedure: 'OSTN02'.
% Execution halted at: $MAIN$ 

I have tried following the guide from Harris Geospatial, but I am getting nowhere. The code is below:

FUNCTION OSTN02, DATA, EASTCOL, NORTHCOL

  ;MAY NEED TO ADD FILLNaN HERE
  DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',')

  RETURN, DATAFILE
  STOP
END

Any help is much appreciated. Thank you.

Upvotes: 0

Views: 728

Answers (1)

mgalloy
mgalloy

Reputation: 2386

The error message is telling you:

% Attempt to call undefined procedure: 'OSTN02'.

You have defined a function, but IDL is looking for a procedure (because you are calling it as a procedure). The call to your function should be:

datafile = ostn02(data, eastcol, northcol)

although you aren't using those parameters, so you might want to remove them from your function.

Upvotes: 1

Related Questions