Thread: Passing Objects
View Single Post
  #13  
Old 06-10-2006, 06:52 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by ApothiX
There is no way to pass them via triggeractions, but I did come up with a little way to avoid that.

To send it:
PHP Code:
temp.object = new TStaticVar();
temp.object.test "Testing 123";

temp.arrayholder NULL
for(temp.vnametemp.object.getdynamicvarnames()) {
  
temp.arrayholder.add(temp.vname "=" temp.object.(@temp.vname));
}

triggerserver("gui"this.name"sendobject"temp.arrayholder); 
To receive it:
PHP Code:
function onActionServerside() {
  if(
params[0] == "sendobject") {
    
temp.object.loadvarsfromarray(params[1]);
    echo(
temp.object.test);
  }

You know there is a built-in savevarstoarray function

HTML Code:
temp.object = new TStaticVar();
temp.object.test = "test";
temp.object.test.bar = "test2";

temp.arrayholder = temp.object.savevarstoarray(false);
echo(temp.arrayholder) outputs
HTML Code:
scriptlogmissingfunctions=false,timeout=0,joinedclasses=,test=test,test.bar=test2
http://wiki.graal.net/index.php/Crea...lVar#Functions
Reply With Quote