Re: TIB: String Arrays, GOSUB


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

Re: TIB: String Arrays, GOSUB





Yes, but if you store all your code in a separte sub program then you can 
use it as a gosub, by using the return command in the sub program:

prgmA
:Disp "HI"
:prgmPAUSE
:Disp "HELLO"
:prgmPAUSE
:Disp "HOWDY"
:prgmPAUSE


prgmPAUSE
:Pause
:ClrHome
:Return


That works exactly as a gosub, and I have also found from experience that 
the more sub programs you have the faster the program runs, bcause it 
doesn't take as much run time to find the labels.


On Mon, 27 Oct 1997, Rene Kragh Pedersen wrote:

> Jeff Ryan wrote:
> > 
> > Matthew wrote:
> > 
> > > couldn't you simply use goto and lables instead of gosub?
> > >
> > > just a thought...
> > >
> > 
> > Sounds like a pretty good idea... Just wish some1 would have thought of it
> > sooner.
> 
> Not really, the diff is that gosub can come from different places in the
> program, and will return to where it came from when it reaches the
> "return" in the program.
> 
> You can't use lbl and goto from two different places to one. However,
> you can use the Define command, it just isn't the same...
> 
> -- 
>           Rene Kragh Pedersen
> -----------------------------------------------
> .oO) Aibohphobia - the fear of palindromes (Oo.
> 

Champaign Central Cross Country - "Running is a privlige not a right"
|-----------------------------------------------------------|
|Robert M. Gardner          | Turbo C++ Programmer          |
|Lilprog@prairienet.org     | HTML Web page writer          |
|                           | Knows Unix, Dos, and Windows  |
|-----------------------------------------------------------|


Follow-Ups: References: