home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a054 / 1.img / GETEXS.EXE / GETEX01.PRG < prev    next >
Encoding:
Text File  |  1992-03-16  |  1.6 KB  |  57 lines

  1.     // Getex01 - Rework of Gets04.prg to use dictionary
  2.     //           in Get:cargo
  3.     //
  4.  
  5.     MEMVAR GetList
  6.  
  7.     #xtranslate GET_NUMBER(<cName>)                                  ;
  8.                 =>                                                   ;
  9.                 Ascan(GetList, {|o| Trim(Upper(o:name)) == <cName>}) 
  10.  
  11.     #xtranslate GET_NUMBER(<cName>, <gl>)                            ;
  12.                 =>                                                   ;
  13.                 Ascan(<gl>, {|o| Trim(Upper(o:name)) == <cName>})
  14.  
  15.  
  16.     FUNCTION Getex01
  17.  
  18.     LOCAL nQty := 0
  19.     LOCAL nDiscount := 0
  20.     LOCAL nAccount  := 0
  21.     LOCAL aDict := DictNew()
  22.  
  23.       CLEAR SCREEN
  24.       @ 10, 10 SAY "Enter Quantity" GET nQty ;
  25.                VALID {|oGet| ResetQty(oGet, GetList), .T.}
  26.       @ 11, 25 GET nDiscount WHEN nQty > 10
  27.  
  28.       DictPutPair(aDict, {"Row",  11})
  29.       DictPutPair(aDict, {"Col",  11})
  30.       DictPutPair(aDict, {"Text", "Enter Discount"})
  31.       Atail(Getlist):cargo := aDict
  32.  
  33.       @ 12, 10 SAY " Enter A / C #" GET nAccount
  34.       READ
  35.  
  36.     RETURN NIL
  37.  
  38.  
  39.     FUNCTION ResetQty(oGet, GetList)
  40.  
  41.     LOCAL nDiscGet := GET_NUMBER("NDISCOUNT")
  42.  
  43.     LOCAL oDiscGet := GetList[nDiscGet]
  44.     LOCAL aDict := oDiscget:cargo
  45.  
  46.       IF oGet:varGet() <= 10
  47.         oDiscGet:varPut(0)
  48.         oDiscGet:display()
  49.         @ DictAt(aDict, "Row"), DictAt(aDict, "Col") ;
  50.           SAY Space(Len(DictAt(aDict, "Text")))
  51.       ELSE
  52.         @ DictAt(aDict, "Row"), DictAt(aDict, "Col") ;
  53.           SAY DictAt(aDict, "Text")
  54.       ENDIF
  55.  
  56.     RETURN NIL
  57.