Greetings,

On Fri, 30 Apr 2010 23:19:23 +0200, Joep Suijs wrote
> Hi guys,
> 
> Volatile vars do puzzle me more and more. This is realy complicated
> stuff to understand in full detail!

Part of this is volatile variables mean two *different* things depending on
how they're used!

> 
> Maybe you can think with me about the expected behavior of the next code:
> 
> procedure aabb (volatile byte in aa) is

When passed to a procedure, `volatile byte in aa,' passes the pseudo-variable
a'get. If one doesn't exist, one is created for you.

>    aa=aa+1

This should fail, and does. But not gracefully. If you pass, `in out,' this
will succeed.

To make things even stranger, if you simply pass `byte in aa',' then aa = aa +
1 is well defined.

>    print_var(aa) ;point 1
> end procedure
> 
> var byte a = 7
> print_var(a)     ; point 2

The value of a will not change unless it is an OUT variable.

--kyle

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to