Jump to content




Variable clear


  • You cannot reply to this topic
1 reply to this topic

#1 Nic

  • Members
  • 10 posts

Posted 31 May 2014 - 02: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?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 31 May 2014 - 05: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 by Bomb Bloke, 31 May 2014 - 05:34 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users