Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Assigning Lua tables

Assigning Lua tables

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Artel   USA  (65 posts)  Bio
Date Sun 24 Aug 2008 12:28 AM (UTC)

Amended on Sun 24 Aug 2008 12:29 AM (UTC) by Artel

Message

spl_tmp_array = {}
...
spl_tmp_array[#spl_tmp_array+1] = spl_names[ i ]
Note("adding "..spl_names[ i ][1]) -- works fine, outputs in my world
Note("adding "..spl_tmp_names[#spl_tmp_array][1]) -- causes the error below


[string "Plugin"]:245: attempt to index global 'spl_tmp_names' (a nil value)


I have a table (spl_names) whose elements are also tables. In the code above, I am trying to assign one of those elements to a be a new element in a different table. As I understand it, both elements should then point to the same exact table. But, I am getting an error on the last line of the snippet, saying that it's a nil value.

Does anyone have any clues on how to fix this?

Artel.
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #1 on Sun 24 Aug 2008 12:53 AM (UTC)
Message
Probably because you are mixing up your tables.

You'll most likyl want to change that spl_tmp_names variable to say spl_tmp_array, like in the rest of your code. :)
Top

Posted by Artel   USA  (65 posts)  Bio
Date Reply #2 on Sun 24 Aug 2008 01:02 AM (UTC)
Message
Oops...

Thanks!

Artel.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,130 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.