comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Strange error: % Keyword parameters not allowed in call.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Strange error: % Keyword parameters not allowed in call. [message #86291] Wed, 23 October 2013 08:21 Go to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
so, I've got this big program with lots of things happening. There is this method (function) used to get images called "GetRawImg" that calls a function "GetFile"

So the call is done this way:

fName = 'MyFileName.dat'
ErrorRes = 0B
Img = GetFile(fName, ErrorRes)

The function GetFile is defined this way:

FUNCTION GetFile, Filename, ErrorRes

I'm debugging this thing and when I get on the line
Img = GetFile(fName, ErrorRes)
and step further into GetFile, I get the error:

% Keyword parameters not allowed in call.
% Keyword parameters not allowed in call.
% Keyword parameters not allowed in call.
% Compiled module: GETFILE.

Yes, three times and after the call it shows that it has compiled GETFILE.
Does anybody have an idea where this is coming from? Is there somewhere a hidden procedure GETFILE that does not accept parameters? I closed all possible related projects before hand...
And when I call this procedure GETFILE the second time, no error is displayed.

Regards,
Helder
Re: Strange error: % Keyword parameters not allowed in call. [message #86292 is a reply to message #86291] Wed, 23 October 2013 08:35 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Helder writes:

> Yes, three times and after the call it shows that it has compiled GETFILE.
> Does anybody have an idea where this is coming from? Is there somewhere a hidden procedure GETFILE that does not accept parameters?

You could check. Start a fresh IDL session and type this:

IDL> Print, File_Which('getfile.pro')

Is that pointing to what it should be pointing to?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Strange error: % Keyword parameters not allowed in call. [message #86293 is a reply to message #86291] Wed, 23 October 2013 08:37 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Helder writes:

> Yes, three times and after the call it shows that it has compiled GETFILE.
> Does anybody have an idea where this is coming from? Is there somewhere a hidden procedure GETFILE that does not accept parameters?

Or, if this is not in its own file (probably likely with a name like
GetFile), compile GetRawImg, then type this command:

IDL> Help, /Source

and look for where it is finding GetFile.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Strange error: % Keyword parameters not allowed in call. [message #86298 is a reply to message #86293] Wed, 23 October 2013 15:10 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, October 23, 2013 5:37:34 PM UTC+2, David Fanning wrote:
> Helder writes:
>
>
>
>> Yes, three times and after the call it shows that it has compiled GETFILE.
>
>> Does anybody have an idea where this is coming from? Is there somewhere a hidden procedure GETFILE that does not accept parameters?
>
>
>
> Or, if this is not in its own file (probably likely with a name like
>
> GetFile), compile GetRawImg, then type this command:
>
>
>
> IDL> Help, /Source
>
>
>
> and look for where it is finding GetFile.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Thanks David for your quick answers. I was out of the office...

[I found the solution to the problem... after I wrote an answer. See below]

So I tested both solutions.
1) Print, File_Which('getfile.pro')
points to the correct file.

2) I tried compiling GetRawImg (method of an object) and I get all the methods compiled, but "getfile.pro" does not appear in the "Help, /source".

I tried executing the whole program with a break-point just before the getfile call. And just when I press F5 (step-into) I get the message:

% Keyword parameters not allowed in call.
% Keyword parameters not allowed in call.
% Keyword parameters not allowed in call.
% Compiled module: GETFILE.
% Stepped to: GETFILE 1 E:\CommonPros\InputPros\getfile.pro

+++++++++++++++++

Ok, so here was the problem.
In the function "getfile.pro" there was a typo that generated this error:

Return, Result = Dist(200)

I probably some when copied and pasted the "Result" after the return...

If you try this in a function you will just get the error:
% Keyword parameters not allowed in call.

I kept on looking at the definition of the function and how I was calling it... wrong place.

At least I dug the bug out of its nest.

Thanks David. Never used "help, /source". It's kind of spooky when you get so many lines out. You start to ask yourself if you should optimize your code. Once again.

Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to obtain contour data through contour command?
Next Topic: How to package existing non-OO widget application into a catalyst based objects?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:56:25 PDT 2025

Total time taken to generate the page: 0.00522 seconds