[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Goto or equivalent?
From: |
Etienne Grossmann |
Subject: |
Re: Goto or equivalent? |
Date: |
Fri, 16 Apr 2004 14:26:48 -0400 |
User-agent: |
Mutt/1.4.2.1i |
Hi Vic,
return will terminate a script too.
There is no goto that I know of in octave.
Hth,
Etienne
On Fri, Apr 16, 2004 at 07:52:59AM -0400, Vic Norton wrote:
# Is there any goto or equivalent in octave? I can't seem to find one.
#
# At the simplest level I would like to write something like
#
# ...
# code
# ...
# if (you_are_done)
# goto END_MAIN;
# endif
# ...
# more code if not done
# ...
# END_MAIN:;
#
# This mechanism can easily accomplished in a subroutine. Just replace
# "goto END_MAIN" with "return" and forget the last line. But can it be
# done in the main program without a big if-block?
#
# Regards,
#
# Vic
#
#
#
# -------------------------------------------------------------
# Octave is freely available under the terms of the GNU GPL.
#
# Octave's home on the web: http://www.octave.org
# How to fund new projects: http://www.octave.org/funding.html
# Subscription information: http://www.octave.org/archive.html
# -------------------------------------------------------------
#
--
Etienne Grossmann ------ http://www.cs.uky.edu/~etienne
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------