[Gambas-user] New Syntax, SUPER && !comprehension(mine) Re.: SUPER example at gambasdoc

Stephen sbungay at ...3301...
Thu May 8 15:00:38 CEST 2014


   Looking at the thread "New syntax for using variables arguments in a 
function call" I realized that I needed to really brush up on my 
somewhat marginal understanding of the evolving (a good thing) GAMBAS 
and OOP. Not fully understanding "SUPER" (I've never used it but can see 
a use for it) I trotted off to Google and the GAMBAS documentation, 
where much reading was done, and (as usual) more questions raised.
   Studying the "SUPER" example at http://gambasdoc.org/hemp/lang/super, 
I wondered at the purpose of a collection that seems not to be used but 
once and some syntax in it's use in the example, which didn't make any 
sense to my old brain. Below is a snippet from the example (where $cPos 
is a collection, $aKey an Array of String Objects (I think) and Key a 
string object;

$cPos.Clear
$cPos[Key] = $aKey.Count
$aKey.Add(Key)

   OK, the first line clears the collection, got it, and the last line 
adds the contents of "String" to $aKey, got that.... but what does the 
second line do? It looks like it is adding the count of elements in 
$aKey to the collection $cPos... but in OOP I would use a method call 
i.e. $cPos.Add(Key,Key). Oh, and in trying to implement the example 
GAMBAS (3.5.3) complained that "ListBox.Add is incorrectly overridden".

-- 
Kindest Regards
Steve :)





More information about the User mailing list