[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Goto or equivalent?

From: Paul Kienzle
Subject: Re: Goto or equivalent?
Date: Fri, 16 Apr 2004 22:56:46 -0400

On Apr 16, 2004, at 7:52 AM, 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

   if (you_are_done)
      goto END_MAIN;
   more code if not done

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?

A big while block with break/continue is more flexible than if.

Paul Kienzle

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]