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

Home » Public Forums » archive » Re: Stop and return to caller
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Stop and return to caller [message #71798 is a reply to message #71764] Wed, 21 July 2010 08:11 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Jul 21, 8:03 am, "Deckard++;" <arthur.vi...@gmail.com> wrote:
> Hi,
>
> I have a small question for which I haven't found a pleasant solution.
> I am looking for a way to stop the execution of a procedure and return
> to the level of the programme that called that procedure. Currently I
> have something like this:
>
> pro my_pro,a,b
>    on_error,2
>
>    c = a + b
>    if (c lt 0) then message,'c < 0! Stopping...'
> end
>
> It works, but the main problem is that since it is generated as an
> error, it outputs all the calling stack with line numbers and so on. I
> would like to do something cleaner, like for instance the "stop"
> procedure which outputs only the current position in the execution.
>
> Thanks a lot in advance,
>
>  -- Arthur;


You should use the command "return" for that - it can be used in
procedures too.

pro test

... stuff

if condition EQ true then return

... stuff

end

Ciao,
Paolo
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Batch mode and ssh...
Next Topic: need help turning this loop into an array

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

Current Time: Sun Oct 12 17:06:34 PDT 2025

Total time taken to generate the page: 1.89206 seconds