
-----------------------------------
fabulos
Sun May 08, 2005 12:23 pm

process problem
-----------------------------------
if u make a process with variables, eg x := 2 

and then later when u call that process, after x has changed many times, how do u make sure that the x in the process has also changed?

-----------------------------------
Delos
Sun May 08, 2005 12:31 pm


-----------------------------------
If 'x' is global, then it will change independant of the process.  If 'x' is local, then I suggest using parameters within your process to control 'x' externally.

So...


var x : int := 0

process a
%...
x += 2
end a

fork a
% x is independant of a



process a (var inVar : int)
var x : int := inVar
%...
x += 2
end a

var control : int := 0
fork a(control)
% x is local to a, but externally controlled.

