home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a054 / 1.img / GETPRGS.EXE / GETS03.PRG < prev    next >
Encoding:
Text File  |  1992-03-01  |  1.1 KB  |  40 lines

  1.     // Gets03.prg
  2.     //
  3.     // Simple when, handling awkward problem
  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.     FUNCTION gets03
  16.  
  17.     LOCAL nQty := 0
  18.     LOCAL nDiscount := 0
  19.     LOCAL nAccount  := 0
  20.  
  21.       CLEAR SCREEN
  22.       @ 10, 10 SAY "Enter Quantity" GET nQty ;
  23.                VALID {|oGet| ResetQty(oGet, GetList), .T.}
  24.       @ 11, 10 SAY "Enter Discount" GET nDiscount WHEN nQty > 10
  25.       @ 12, 10 SAY " Enter A / C #" GET nAccount
  26.       READ
  27.  
  28.     RETURN NIL
  29.  
  30.     FUNCTION ResetQty(oGet, GetList)
  31.  
  32.     LOCAL nGet := GET_NUMBER("NDISCOUNT", GetList)
  33.  
  34.       IF oGet:varGet() <= 10
  35.         GetList[nGet]:varPut(0)
  36.         GetList[nGet]:display()
  37.       ENDIF
  38.  
  39.     RETURN NIL
  40.