SystemNames: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
New page: === SystemNames === '''Description:'''<br> Table to translate systemid's into system names and back. Note that the "ID to name" translation returns names with capital letters, but the "nam...
 
No edit summary
Line 5: Line 5:
'''Example'''
'''Example'''
<source lang="lua">
<source lang="lua">
print(SystemNames[16]) -- Prints the name of the system with ID 4079, "Pelatus"
print(SystemNames[16]) -- Prints the name of the system with ID 16, "Pelatus"
print(SystemNames["pelatus"]) -- Prints 16
print(SystemNames["pelatus"]) -- Prints 16
print(SystemNames["Pelatus"]) -- Prints "nil" (note the capital P)
print(SystemNames["Pelatus"]) -- Prints "nil" (note the capital P)
</source>
</source>

Revision as of 22:14, 26 January 2009

SystemNames

Description:
Table to translate systemid's into system names and back. Note that the "ID to name" translation returns names with capital letters, but the "name to ID" translation only works with all lower-case names.

Example <source lang="lua"> print(SystemNames[16]) -- Prints the name of the system with ID 16, "Pelatus" print(SystemNames["pelatus"]) -- Prints 16 print(SystemNames["Pelatus"]) -- Prints "nil" (note the capital P) </source>