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

Reading and printing tables stored in files

Started by LeviM, 26 October 2015 - 06:33 PM
LeviM #1
Posted 26 October 2015 - 07:33 PM
I have a few files stored on disk drives that look like these: http://pastebin.com/g5MqaN79
And I read and display them with this file: http://pastebin.com/GWE1YsDq

However, when I run this file it gets displayed as this:


My question is, why do the networth and owner values display like that? And how do I fix it?
Edited on 26 October 2015 - 06:55 PM
TYKUHN2 #2
Posted 26 October 2015 - 07:52 PM
First issue I notice is both links are the same.
Though with a little Ctrl-C Ctrl-V I found the right link.
Edited on 26 October 2015 - 06:53 PM
LeviM #3
Posted 26 October 2015 - 07:56 PM
First issue I notice is both links are the same.
Though with a little Ctrl-C Ctrl-V I found the right link.
fixed, sorry
valithor #4
Posted 26 October 2015 - 08:03 PM
The reason those two are the only two that do not have the [""] around them is because they are single worded keys to the table. You can not have a multi-word variable, so in order for the key to work for those that are multi-worded the brackets must be there. However, they are not needed for those two single worded ones so they are removed.
LeviM #5
Posted 26 October 2015 - 08:07 PM
The reason those two are the only two that do not have the [""] around them is because they are single worded keys to the table. You can not have a multi-word variable, so in order for the key to work for those that are multi-worded the brackets must be there. However, they are not needed for those two single worded ones so they are removed.

Thanks!