[Coco] Sharing a value with the calling routine in Basic09

Christopher R. Hawks chawks at dls.net
Sat Aug 15 14:50:43 EDT 2020


On Sat, 15 Aug 2020 14:21:02 -0400
coco at jechar.ca wrote:

> 
> On 2020-08-15 14:17, coco at jechar.ca wrote:
> > Would like to know if there is a standard way to pass back the
> > value from a called routine to the caller. Cannot use GOSUB the
> > routines need to be separate modules although a merged module file
> > could be created by OS9 afterwards to make sure that if one module
> > is loaded the other is too.
> > 
> > I have an Idea involving ADDR PEEK and POKE of course if I am wrong
> > this could go very wrong.
> > 
> > Charlie
> 
> PS: I think what I am trying to do is called pass by reference
> in C++
> 

    Parameters passed to Basic09 procedures are normally passed by
reference. The new values are used by the caller.

    See the Basic09 manual "Parameter Variables" section (pages 33 and
34).


Christopher R. Hawks
HAWKSoft
-- 
"Eating kittens is just plain wrong, and no-one should do it, ever!!" 
		-- The Tick
----------------------------------------
       \   ^__^                         
        \  (oo)\_______                 
           (__)\       )\/\           
               ||----w |                
               ||     ||                


More information about the Coco mailing list