I use defstruct to define a struct variable. For example:
defstruct(mystruct aaa bbb)
s1 = make_mystruct(?aaa 1 ?bbb 2)
then I use setVarWriteProtect to make s1 write protected:
But when I change s1->aaa = 5, it still can be modified. Seems only s1 is write protected, but no its member variables.
How to write protect the member variable s1->aaa? Is there anyway to do it in Skill if not by function setVarWriteProtect?
Generally variables should be set to be local by including them in a let statement. Local variables cannot be changed by users.
You may have to re-think your code if you want to protect the contents of a global variable. The documentation states that the behavior of this is not specified.