Hi everyone,
I have come accross a strange behaviour.
I am trying to pass message to my gui via msg.post but somehow when I name the message_id as “set_text”, only text part of my table is transferred.
E.g.:
msg.post("#debug_window", "set_text", {name="stime", text=value})
So I am clearly sending a table with two values but I get this
pprint({message_id, message, sender})
-------------------------------------
{ --[[000001F353CC5790]]
1 = hash: [set_text],
2 = { --[[000001F353CC5660]]
text = "Time: 0.00 s"
},
3 = url: [main:/go#debug_helper]
}
If the passed table does not contain “text” field it throws an error
ERROR:SCRIPT: main/debug_helper.script:24: Field text not specified in table
But if I were to choose different message_id than “set_text” it works as expected.
And yet another thing, If I choose “set_name” it also works as expected.
You can see output messages here:
Console_output_example.txt (1.1 KB)
So my question is… Is the “set_text” some kind of reserved word?
I did not find anything about it and there is a lot of information about msg.post, so I just got lost after some time.
This is a test project I made in order to eliminate my other work.
msg_passing_test.zip (61.2 KB)
Thanks for your help in advance
Azurac