Quote:
Originally Posted by scriptless
Hmm, well is there any instance that I would be forced to use TStaticVar, or better to use? I generally find myself just using vars like I mentioned. Not sure if that is good practice, or if I should look more into using TStaticVar's?
Sorry if it sounds like a noob question just the overwhelming lack of documentation for GScript2 makes understanding somewhat difficult at times.
Also, thanks FP4 for the reply. Ans also not trying to hijack the thread. It's still relevant to discussion of the TStaticVar.
|
If you don't want to constantly serialize your dictionary ("object") every time you want to pass it around, you can use a TStaticVar instead. This can be moderately faster and easier to read (less boilerplate).
This won't work going across serverside/clientside, of course -- you'll need to serialize in this case.
Also iirc savevarstoarray on a non-TStaticVar will include the random built-in object properties (stuff like initialized, joinedclasses, timeout, ...) in at least some cases. But I can't remember if that's true or not.