When calling GetValue before SetValue there is different behavior. Either it doesn't return the table or it never set it properly. See attached example code.
Can you tell me the output of your example? I'm willing to accept a pull request submitted by you that fixes this behavior and try to help you work through it if needed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Wizzard. I was able to isolate the problem in the code I was writing to this behavior in Sqrat/squirrel. I haven't taken the time yet to find and fix the issue. I was hoping you had some idea what might be going wrong. I can keep looking at it if you like. Below is the output I got from the test case. In both cases it will call the SetValue but only case A returns the table in the last GetValue call (the one after SetValue).
Test Case A===========
Set
Get OK
Test Case B===========
Set
Get FAILED
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Wizzard, it looks like I didn't read the API documentation very well. It's setting the error in the VM and it needs to be cleared. Clearing the error between the GetValue and SetValue fixed it:
Sqrat::Error::Clear(vm);
It's a bit unfortunate you have to know to do this but no change to the code should be needed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Glad you got it worked out! The way I chose to do errors is pretty weird, but I was trying to make it backwards compatible because Sqrat started off with no error checking at all!
(it actually works quite a bit faster too when you compile with error checking off)
Last edit: Wizzard 2021-11-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you tell me the output of your example? I'm willing to accept a pull request submitted by you that fixes this behavior and try to help you work through it if needed.
Hi Wizzard. I was able to isolate the problem in the code I was writing to this behavior in Sqrat/squirrel. I haven't taken the time yet to find and fix the issue. I was hoping you had some idea what might be going wrong. I can keep looking at it if you like. Below is the output I got from the test case. In both cases it will call the SetValue but only case A returns the table in the last GetValue call (the one after SetValue).
Hi Wizzard, it looks like I didn't read the API documentation very well. It's setting the error in the VM and it needs to be cleared. Clearing the error between the GetValue and SetValue fixed it:
It's a bit unfortunate you have to know to do this but no change to the code should be needed.
Glad you got it worked out! The way I chose to do errors is pretty weird, but I was trying to make it backwards compatible because Sqrat started off with no error checking at all!
(it actually works quite a bit faster too when you compile with error checking off)
Last edit: Wizzard 2021-11-26