settings.get

From ComputerCraft Wiki
Revision as of 03:22, 10 June 2016 by Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=settings.get |args={{type|string}} name [, {{type|any}} default] |returns={{type|any}} value |api=settings |addon=ComputerCraft |desc=Returns th...")

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


Grid Redstone.png  Function settings.get
Returns the value of a given setting, or if the setting doesn't exist and a "default" is specified, returns the specified default instead.
Syntax settings.get(string name [, any default])
Returns any value
Part of ComputerCraft
API settings

Examples

Grid paper.png  Example
Indicates whether the system is currently configured to boot from disk.
Code
local bootFromDisk = settings.get("shell.allow_disk_startup", "not set")

print("Ability to boot from disk is currently " .. tostring( bootFromDisk ) )
Output Either states "true", "false", or "not set".


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