settings.unset

From ComputerCraft Wiki
Revision as of 03:10, 10 June 2016 by Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=settings.unset |args={{Type|string}} setting |api=settings |addon=ComputerCraft |desc=Removes a setting from the currently loaded set. If you wi...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function settings.unset
Removes a setting from the currently loaded set. If you wish to unload all settings, refer to settings.clear().
Syntax settings.unset(string setting)
Returns nil
Part of ComputerCraft
API settings

Examples

Grid paper.png  Example
Randomly unsets a setting.
Code
local curSettings = settings.getNames()

print("Initial loaded settings:\n")
textutils.pagedTabulate( curSettings  )

if #curSettings > 0 then settings.unset( curSettings[ math.random( #curSettings ) ] ) end

print("\nResulting loaded settings:\n")
textutils.pagedTabulate( settings.getNames() )


Grid disk.png Settings API Functions
settings.set - settings.get - settings.unset - settings.clear - settings.getNames - settings.load - settings.save