tag in a script
tag in a script
item.setTag()
LL.setScriptTag()
a little delicate method name difference.
At first, I thought two methods do the same feature like persistent data storing, but one to a item, the other to global(?) LL.
API doc says,
setScriptTag (String tag)
Set a persistent tag data for the currently executing script.
does “currently executing script” have special meaning? ie, other scripts can’t see that LL tag? I thought LL is global object. However API seems to say this a global just to an script?
And both item tag and LL tag can have persitent data after reloading LL app, right?
]]>
< ![CDATA[
This is a way to store persistent “global” data without needing to have an item for that.
Yes, currently executing script has a special meaning, because you can launch a script from another one. When doing so, calling set/getScriptTag will store and load a data for the script at the origin of the call, not the script at the origin of the “runScript” call. There are some limitations though, this can be tricky.
The method setScriptTag is currently on the LL object. I would have prefered to use a dedicated Script object with a setTag method, but I don’t wish to introduce this object now. If needed I can do it later and keep the LL.setScriptTag and mark it as deprecated.
]]>
< ![CDATA[
Thanks for your answering.
It seems to be a liffle difficult for me to understand those situations right now
,.I will just try and get errors 🙂
]]>