View Single Post
  #3  
Old 01-28-2012, 08:31 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by fowlplay4 View Post
You have to create a TStaticVar then assign it a variable. I.e:

PHP Code:
function onCreated() { 
  
temp.obj2 test(); 
  echo(
temp.obj2.hello);
  
temp.obj2.destroy();
  
  
// this also works
  
echo(test().hello);


function 
test() {
  
temp.obj = new TStaticVar();
  
temp.obj.hello "world"
  return 
temp.obj

You can write some neat looking code with it.
Ah, I remember using TStaticVar() once about a year ago. Forgot all about it. Indeed, yes you can write some pretty neat code.

Quote:
Originally Posted by fowlplay4 View Post
PHP Code:
echo(test().hello); 
Now that is awesome!!


Thanks alot.

Would rep+ you but I must share the love first, lol.
Reply With Quote