Advertisement
snake5

the state of SGScript @ 2013-04-11

Apr 11th, 2013
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global G = { /* static and default data goes here */ };
  2.  
  3. // creation function, no specific name required
  4. function G.create( msg )
  5. {
  6.     return class( {msg=msg}, G );
  7. }
  8.  
  9. // some member function (because there's "this" inside it)
  10. function G.print()
  11. {
  12.     println( this.msg );
  13. }
  14.  
  15. var myg = G.create( "yo!" );
  16. myg.print();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement