![]() |
Objects into Arrays using Add()?
Hmm, I was working a multiple object arrays and such. When I came across a problem. Using add to add objects to and array when they are returned from a function. Is there a problem here? It's worked before. :[
SERIALIZE FUNCTION PHP Code:
PHP Code:
|
had a similar problem:
http://forums.graalonline.com/forums...ad.php?t=74063 The objects you add have to be TStaticVar. |
Ah, thanks Knight, it worked wonders. :]
|
Stan thats not a real object you're making. And why are you doing makevar("obj2")?
obj2 is already a complete variable name. You would simply use: obj.abilitylist.add(obj2); Quote:
|
Well, I found different.
My script just sopped working but changing the object to a TStaticVar fixed it. |
Quote:
|
Quote:
Personally I wish there was a serveroption to remove all GS1 compatibility, it would maybe stop some people from spewing crap like "GS1 is more logical like GS2", wtf? |
Quote:
Quote:
|
TGraalVar Types:
0 = Numeric 1 = String 2 = Object 3 = Array As you can see, Objects and Arrays aren't quite the same. The only reason the second part worked is because you initialized test2 before trying to add to it, I don't see this for the first part. Arrays themselves are a type of object (TGraalVar) so I see no reason why you need to make it an object beforehand. Just make sure its initialized 'varname = 0;' will do the trick. Here is an example that works: PHP Code:
PHP Code:
|
Quote:
I don't see how it has to do with GS1 at all though. |
Quote:
|
| All times are GMT +2. The time now is 08:19 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.