![]() |
return, function, and object types?
So I was playing with some script and came up with this:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
You have to create a TStaticVar then assign it a variable. I.e:
PHP Code:
|
Quote:
Quote:
Thanks alot. Would rep+ you but I must share the love first, lol. |
Bonus: If you want to send an object and it's vars to the client-side you can do it like this:
PHP Code:
|
Quote:
|
Quote:
PHP Code:
Also the new TStaticVar() on the server-side wasn't necessary because you weren't passing it between two functions so when you call savevarsintoarray it's able to find the a, b, c, and b.a vars. |
that's cool :0
|
More Bonus: Chaining function calls, and that'll pretty much be it for me on this topic.
PHP Code:
Basic ActiveRecord http://forums.graalonline.com/forums...hp?t=134262561 CuteGS2 GUI Builder http://forums.graalonline.com/forums...hp?t=134263993 |
Just be careful to destroy TStaticVars when you're done with them or you'll leak memory.
edit: maybe this is not necessary? Quote:
edit 2: per Skyld, they'll be destroyed eventually if there are no references to them. |
Note that the garbage collection cycles happen when you move your mouse out of the client, and can lock up the client for up to 30 seconds collecting as little as 1000 TStaticVars. (This was a cause of a bug that took me ages to work out.) In the case you are working with a dynamic number of TStaticVars, it's best to manually destroy when you're done with them if you can.
|
| All times are GMT +2. The time now is 01:14 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.