Re: Can Procedures Modify Variables??

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 6 Apr 2002, at 13:58, Sam wrote:

> 
> Hi ...
> 
>    Is it possible to pass a variable to a procedure and have the 
> procedure change the value of the variable??

Yes, check out the word "function".....

> global atom X
> function Add6 (atom X)
>   X = X + 6  
return x
> end procedure
> X = 3
> print (1, X)
> puts (1, "\n")
 x = Add6 (X)
> print (1, X)
> 
> Output: 3
9


>   Thanks for all your help, guys.

And women.

Kat,
meow

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu