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

Variable clear

Started by Nic, 31 May 2014 - 01:55 AM
Nic #1
Posted 31 May 2014 - 03:55 AM
so i was looking for a way to clear a variable …

so if i had


local id, message = rednet.receive()

and say i wanted to use message again how would i got about this?

ps. how do i do the show and hide thing?
Bomb Bloke #2
Posted 31 May 2014 - 06:33 AM
If you want to use "message" again, you just… use it again. You don't need to clear its previous content first, that can be overwritten.

But if you really want to wipe a variable's content (which can be useful in the case of table indexes):

message = nil

Note that all local variables are generally auto-wiped when the block they were defined in ends.

Spoiler tags look like so: [spoiler][/spoiler]
Edited on 31 May 2014 - 04:34 AM