home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a066 / 1.img / DICTDEMO.PRG < prev    next >
Encoding:
Text File  |  1992-03-20  |  615 b   |  28 lines

  1. /*
  2.         dictdemo.prg
  3.  
  4.         Trivial demonstartion of dictionary class.
  5. */
  6.  
  7. procedure main
  8.     local i, cKey
  9.     local dict := Dictionary():new
  10.  
  11.     ? "Filling a dictionary object"
  12.     ? "Keys are strings:        'AAAA...' thru 'MMMM...'"
  13.     ? "Values can be anything;"
  14.     ? "in this example:         65 - 77"
  15.     for i := 65 to 77
  16.         cKey := replicate(chr(i), 16)
  17.         dict:put(cKey, i)
  18.     next i
  19.  
  20.     ? "Retrieving in reverse order:"
  21.     for i := 77 to 65 step - 1
  22.         cKey = replicate(chr(i), 16)
  23.         ? cKey, dict:at(cKey)
  24.     next i
  25. return
  26.  
  27. // eof dictdemo.prg
  28.