home *** CD-ROM | disk | FTP | other *** search
- /*
- dictdemo.prg
-
- Trivial demonstartion of dictionary class.
- */
-
- procedure main
- local i, cKey
- local dict := Dictionary():new
-
- ? "Filling a dictionary object"
- ? "Keys are strings: 'AAAA...' thru 'MMMM...'"
- ? "Values can be anything;"
- ? "in this example: 65 - 77"
- for i := 65 to 77
- cKey := replicate(chr(i), 16)
- dict:put(cKey, i)
- next i
-
- ? "Retrieving in reverse order:"
- for i := 77 to 65 step - 1
- cKey = replicate(chr(i), 16)
- ? cKey, dict:at(cKey)
- next i
- return
-
- // eof dictdemo.prg
-