This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ComputerCraftFan11's profile picture

Modify a variable in a new file?

Started by ComputerCraftFan11, 04 March 2012 - 03:58 AM
ComputerCraftFan11 #1
Posted 04 March 2012 - 04:58 AM
Lets say i have 2 programs.

Program 1 has a variable called A

How can I make program 2 change A in program 1?
Casper7526 #2
Posted 04 March 2012 - 05:01 AM
Well technically you can just leave the variable as a global.

Program 1:
x = x or 5
print (x)
x = read()

Program 2:
x = x or 5
print (x)
x = read()