Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Announcements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rating: Thread Rating: 10 votes, 4.60 average. Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 06-18-2013, 10:12 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Gunderak View Post
The class should extend something , try extends TStaticVar.
It will probably make it singleton but eh as long as you only use it once.
But also GS1-3 not being a proper language, it doesn't act like proper languages.
Oddly playing around, if you create the object, the class can extend it o.0 not the actual class though?
PHP Code:
//#GS3
class Foot extends TStaticVar{
  var 
id:int;
}
class 
Toe extends Foot{
  var 
id:int;
}
function 
onCreated():void{
  var 
Foot:Foot = new Foot();
  var 
toe Toe = new Toe();
  
toe.id 1;
  echo(
toe.id);

And yet,

PHP Code:
class Animal { ... }
class 
Cat extends Animal { ... }
class 
Dog extends Animal { ... }
var 
cat Cat = new Cat();
var 
dog Dog = new Dog();
var 
cat_as_animal Animal =  cat as Animal// OK as the Cat type is a member of the Animal type.
var cat_as_cat Cat cat_as_animal as Cat// OK as the Cat type is a member of the Animal type.
var cat_as_dog Dog cat as Dog// KO as the Cat type is not a member of the Dog type.
var cat_as_animal_as_dog Dog cat_as_animal as Dog// null as the Cat as Animal type is not a member of the Dog type. 

Taken from: http://wiki.graal.net/index.php/Crea...t3#as_operator

It did resolve my query regarding referencing the base class..need to use 'as' operator
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.