IDL Function Is Reluctant To Define












0














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.










share|improve this question






















  • Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
    – Steve G
    Nov 12 at 15:28










  • Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
    – Steve G
    Nov 12 at 15:48










  • @SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
    – Fishbones78
    Nov 12 at 16:33










  • Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
    – Steve G
    Nov 12 at 19:23












  • Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
    – Fishbones78
    Nov 13 at 9:05
















0














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.










share|improve this question






















  • Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
    – Steve G
    Nov 12 at 15:28










  • Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
    – Steve G
    Nov 12 at 15:48










  • @SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
    – Fishbones78
    Nov 12 at 16:33










  • Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
    – Steve G
    Nov 12 at 19:23












  • Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
    – Fishbones78
    Nov 13 at 9:05














0












0








0







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.










share|improve this question













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.







function idl-programming-language






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 10:53









Fishbones78

54




54












  • Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
    – Steve G
    Nov 12 at 15:28










  • Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
    – Steve G
    Nov 12 at 15:48










  • @SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
    – Fishbones78
    Nov 12 at 16:33










  • Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
    – Steve G
    Nov 12 at 19:23












  • Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
    – Fishbones78
    Nov 13 at 9:05


















  • Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
    – Steve G
    Nov 12 at 15:28










  • Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
    – Steve G
    Nov 12 at 15:48










  • @SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
    – Fishbones78
    Nov 12 at 16:33










  • Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
    – Steve G
    Nov 12 at 19:23












  • Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
    – Fishbones78
    Nov 13 at 9:05
















Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
– Steve G
Nov 12 at 15:28




Check the name of the file containing your function OSTN02. It should be ostn02.pro. You can get an error like this if the name of the function doesn't match the file name.
– Steve G
Nov 12 at 15:28












Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
– Steve G
Nov 12 at 15:48




Also, I think 'READLIS' should be 'READLIST', but I can't find either function in the online documentation. Maybe it's not compiling properly because it can't get 'READLIS' to compile? Also, the 'STOP' statement at the end is unnecessary, but I don't think it will cause any problems.
– Steve G
Nov 12 at 15:48












@SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
– Fishbones78
Nov 12 at 16:33




@SteveG The name is indeed ostn02.pro already :( I should have added that read_lis is a function that someone here at my company has created. Thank you for the response.
– Fishbones78
Nov 12 at 16:33












Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
– Steve G
Nov 12 at 19:23






Okay, if you just run the line DATAFILE = READLIS(FILE = !DATA_DIR + 'PROJECT ONE/OSTN15_OSGM15_DataFile.CSV', SEP = ',') from the IDL command line, does it work okay? And is it READLIS (as in the post) or read_lis (as in your comment)?
– Steve G
Nov 12 at 19:23














Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
– Fishbones78
Nov 13 at 9:05




Hi @SteveG. Yes, the line runs fine. Silly mistake, I should have proof read it. It is indeed READLIS!
– Fishbones78
Nov 13 at 9:05












1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer





















  • I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
    – Fishbones78
    Nov 13 at 9:08











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260627%2fidl-function-is-reluctant-to-define%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














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.






share|improve this answer





















  • I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
    – Fishbones78
    Nov 13 at 9:08
















1














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.






share|improve this answer





















  • I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
    – Fishbones78
    Nov 13 at 9:08














1












1








1






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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 at 19:25









mgalloy

1,941186




1,941186












  • I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
    – Fishbones78
    Nov 13 at 9:08


















  • I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
    – Fishbones78
    Nov 13 at 9:08
















I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
– Fishbones78
Nov 13 at 9:08




I think I have been a little unclear, so I will elaborate :) The function OSTN02 will do much much more than just define DATAFILE and return it. It's only like this at the moment because I want it to work as a function before I write the rest of it. This is why I also have unused parameters! Thanks for the response
– Fishbones78
Nov 13 at 9:08


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260627%2fidl-function-is-reluctant-to-define%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Error while running script in elastic search , gateway timeout

Adding quotations to stringified JSON object values