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

Home » Public Forums » archive » Re: function signature
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
Re: function signature [message #51127] Fri, 27 October 2006 17:02
Dominic[1] is currently offline  Dominic[1]
Messages: 13
Registered: October 2006
Junior Member
Ok, but is it possible to make the "bar" parameter mandatory at compile
time?

thanks,
dometz



mgalloy@gmail.com wrote:
> Dominic wrote:
>> Hi,
>>
>> Is there a way to add signatures to user written function and
>> procedures? So that validation of method calls are made at compile time
>> vs. run time?
>>
>> example:
>>
>> pro foo, bar
>> ...
>> end
>>
>> some calls in his code:
>> pro calling_foo
>> foo ;without the bar parameter
>> end
>>
>> So, is there a way when calling_foo is compile that it will catch this
>> error at compile time as a syntax error?
>
> But it's not a syntax error. The "bar" parameter might be optional (it
> is up to the "foo" routine to determine what it needs).
>
> On the other hand,
>
> pro foo
> ...
> end
>
> pro calling_foo
> foo, bar
> end
>
> is a syntax error.
>
> Mike
> --
> www.michaelgalloy.com
Re: function signature [message #51129 is a reply to message #51127] Fri, 27 October 2006 16:21 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Dominic wrote:
> Hi,
>
> Is there a way to add signatures to user written function and
> procedures? So that validation of method calls are made at compile time
> vs. run time?
>
> example:
>
> pro foo, bar
> ...
> end
>
> some calls in his code:
> pro calling_foo
> foo ;without the bar parameter
> end
>
> So, is there a way when calling_foo is compile that it will catch this
> error at compile time as a syntax error?

But it's not a syntax error. The "bar" parameter might be optional (it
is up to the "foo" routine to determine what it needs).

On the other hand,

pro foo
...
end

pro calling_foo
foo, bar
end

is a syntax error.

Mike
--
www.michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: cw_dual_slider: a slider with two slides
Next Topic: Re: Image and ROI Help

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

Current Time: Wed Oct 08 13:58:03 PDT 2025

Total time taken to generate the page: 0.00556 seconds