Dealing with objects and the new generics feature mean the syntax has changed quite a bit. Here's an example
Class Dude 'declare a new type
Field name$
Method New(_name$) 'define the constructor function. It can take arguments now!
name = _name
End
End
Local dudes:List<Dude> 'create a new list, which takes Dude objects
dudes.AddLast (New Dude("Jim")) 'add a new Dude to the list.
For Local dude:= EachIn dudes 'You must put Local/Global before variable declarations now, but you can declare type implicitly with the := operator
Print dude.name
Next
|