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

Home » Public Forums » archive » Re: mpfit questions /strange behavior
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: mpfit questions /strange behavior [message #72714] Mon, 04 October 2010 05:09
sirvival is currently offline  sirvival
Messages: 18
Registered: August 2010
Junior Member
Hi,
thanks.
I should not do such things on Friday close to lunch.
I only confused myself.
Re: mpfit questions /strange behavior [message #72718 is a reply to message #72714] Fri, 01 October 2010 09:30 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Oct 1, 11:45 am, Paolo <pgri...@gmail.com> wrote:
> On Oct 1, 6:32 am, sirvival <fpfei...@hs.uni-hamburg.de> wrote:
>
>> Hi,
>> I just started getting used to mpfit.
>
>> My question is:
>> I call mpfit2Dfun as mentioned in the description
>> I have a function (extra pro).
>> If I use return, functionname inside the function I get a different
>> result than when I leave the return blank.
>> What am I doing wrong?
>> Also when the return is blank it runs much faster.
>
> A function returns 0 unless you specify the return
> value. There's no reason whatsoever to use a function
> that does not return a value. The returned variable
> does not need to have the same name as the function
> (in fact that is very confusing and should be avoided).

And a function that always returns 0 is probably quick to fit.
Re: mpfit questions /strange behavior [message #72723 is a reply to message #72718] Fri, 01 October 2010 07:45 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Oct 1, 6:32 am, sirvival <fpfei...@hs.uni-hamburg.de> wrote:
> Hi,
> I just started getting used to mpfit.
>
> My question is:
> I call mpfit2Dfun as mentioned in the description
> I have a function (extra pro).
> If I use return, functionname inside the function I get a different
> result than when I leave the return blank.
> What am I doing wrong?
> Also when the return is blank it runs much faster.

A function returns 0 unless you specify the return
value. There's no reason whatsoever to use a function
that does not return a value. The returned variable
does not need to have the same name as the function
(in fact that is very confusing and should be avoided).

Ciao,
Paolo

[skip]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mind Boggling Problem with Map_Proj_Init
Next Topic: Re: New Colorbar Missing?

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

Current Time: Sun Oct 12 02:20:22 PDT 2025

Total time taken to generate the page: 0.64271 seconds