This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
How do you quickly clear certain variables after a certain program runs?
Started by DiamondOwner, 07 February 2013 - 08:45 AMPosted 07 February 2013 - 09:45 AM
The title states all that needs to be said.
Posted 07 February 2013 - 09:49 AM
Make the variables local.
Posted 07 February 2013 - 10:04 AM
or make them nil
Posted 07 February 2013 - 10:31 AM
thats more work then needed…just make all variables in the program local and they will be cleared when the program ends… like shnupbups saidor make them nil
Posted 07 February 2013 - 11:04 AM
thx. do i have to manually end global variables(when needed) by doing "(variable here)=nil"?
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.
Posted 07 February 2013 - 05:22 PM
Restart the computer
Posted 07 February 2013 - 05:25 PM
Well thats the answer to everything :P/>Restart the computer
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
"Are you sure it's plugged in?"
-Every tech. support ever
Posted 08 February 2013 - 02:17 AM
It's necessary, trust me."Have you tried turning it off and on again?"
"Are you sure it's plugged in?"
-Every tech. support ever
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
you dont need to clear them when your done, they will automatically get collected