Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
LOCAL loCol As Collection, k, n, o
|
||||
CLEAR
|
||||
*!* Example using strings
|
||||
loCol = NEWOBJECT("Collection")
|
||||
loCol.Add("Apples", "A")
|
||||
loCol.Add("Oranges", "O")
|
||||
loCol.Add("Pears", "P")
|
||||
n = loCol.Count
|
||||
? "Items:", n
|
||||
*!* Loop through the collection
|
||||
k = 1
|
||||
FOR EACH o IN loCol FOXOBJECT
|
||||
? o, loCol.GetKey(k)
|
||||
k = k + 1
|
||||
ENDFOR
|
||||
*!* Get an item by its key
|
||||
? loCol("O")
|
||||
?
|
||||
*!* Example using objects
|
||||
LOCAL loFruits As Collection
|
||||
loFruits = NEWOBJECT("Collection")
|
||||
loFruits.Add(CREATEOBJECT("fruit", "Apples"), "A")
|
||||
loFruits.Add(CREATEOBJECT("fruit", "Oranges"), "O")
|
||||
loFruits.Add(CREATEOBJECT("fruit", "Pears"), "P")
|
||||
*!* Loop through the collection
|
||||
k = 1
|
||||
FOR EACH o IN loFruits FOXOBJECT
|
||||
? o.Name, loFruits.GetKey(k)
|
||||
k = k + 1
|
||||
ENDFOR
|
||||
*!* Get an item name by its key
|
||||
? loFruits("P").Name
|
||||
|
||||
|
||||
DEFINE CLASS fruit As Custom
|
||||
PROCEDURE Init(tcName As String)
|
||||
THIS.Name = tcName
|
||||
ENDPROC
|
||||
ENDDEFINE
|
||||
Loading…
Add table
Add a link
Reference in a new issue