lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It gets even more peculiar. If I print the table keys and values the key==userdata evaluates to true but accessing the table with each of them gives different results i.e. data[key] ~= data[userdata]. I have attached the updated script.




On Wed, Sep 3, 2014 at 7:20 PM, Milind Gupta <milind.gupta@gmail.com> wrote:
Sorry, the right attachment is this one:


On Wed, Sep 3, 2014 at 7:15 PM, Milind Gupta <milind.gupta@gmail.com> wrote:
Hi,
     I am using the element handle of a multiline text control as a key in a table (data). But when the table is accessed in the map_cb function (called when the control is mapped) the value for that key is somehow lost! 
    I have the test case in the attached script. The print statements show that the right key is passed to the map_cb function but the table shows a nil value at that time.
     What am I doing wrong?

Thanks,
Milind


Attachment: table_loosing_value.lua
Description: Binary data