Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 process problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
fabulos




PostPosted: Sun May 08, 2005 12:23 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sun May 08, 2005 12:31 pm   Post subject: (No subject)

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...

Turing:

var x : int := 0

process a
%...
x += 2
end a

fork a
% x is independant of a


Turing:

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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: