8. Context Variables
Aus Hugo Doku
Use context variables to forward the value of a variable to its child frame objects. Father and child object therefore have to declare the same context variable. After the child object has been created its initial value is set to that of the father's value.
Context variables are declared as follows:
public @#contype var_name;
HuGo knows the following context variable types:
Contypes
| contype | Meaning |
|---|---|
| String | a String like in Java (call-by-value) |
| int | a int like in Java (call-by-value) |
| double | a double like in Java (call-by-value) |
| boolean | a boolean like in Java (call-by-value) |
| HashSet | a HashSet like in Java (call-by-reference) |
| HashMap | a HashMap like in Java (call-by-reference) |
Call-by-value means, that after the child as changed the value, the value of the father's variable still remains. Call-by-reference means, that a reference to the object will be forwarded, i.e. after the child as changed the value, the father's value will have changed automatically.
<not documented further yet, examples missing>
Next: 9. Declaration of Slots

