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

How do you quickly clear certain variables after a certain program runs?

Started by DiamondOwner, 07 February 2013 - 08:45 AM
DiamondOwner #1
Posted 07 February 2013 - 09:45 AM
The title states all that needs to be said.
Shnupbups #2
Posted 07 February 2013 - 09:49 AM
Make the variables local.
ikke009 #3
Posted 07 February 2013 - 10:04 AM
or make them nil
Skullblade #4
Posted 07 February 2013 - 10:31 AM
or make them nil
thats more work then needed…just make all variables in the program local and they will be cleared when the program ends… like shnupbups said
DiamondOwner #5
Posted 07 February 2013 - 11:04 AM
thx. do i have to manually end global variables(when needed) by doing "(variable here)=nil"?
Lyqyd #6
Posted 07 February 2013 - 11:12 AM
Yes, but, if you're using global variables, there's a good chance you're doing it wrong. The cases where they are necessary are few and far between.
remiX #7
Posted 07 February 2013 - 05:22 PM
Restart the computer
lieudusty #8
Posted 07 February 2013 - 05:25 PM
Restart the computer
Well thats the answer to everything :P/>
ikke009 #9
Posted 08 February 2013 - 01:58 AM
"Have you tried turning it off and on again?"
"Are you sure it's plugged in?"
-Every tech. support ever
D3matt #10
Posted 08 February 2013 - 02:17 AM
"Have you tried turning it off and on again?"
"Are you sure it's plugged in?"
-Every tech. support ever
It's necessary, trust me.
PixelToast #11
Posted 08 February 2013 - 03:09 AM
or just make them local
you dont need to clear them when your done, they will automatically get collected