home *** CD-ROM | disk | FTP | other *** search
- // Gets03.prg
- //
- // Simple when, handling awkward problem
-
- MEMVAR GetList
-
- #xtranslate GET_NUMBER(<cName>) ;
- => ;
- Ascan(GetList, {|o| Trim(Upper(o:name)) == <cName>})
-
- #xtranslate GET_NUMBER(<cName>, <gl>) ;
- => ;
- Ascan(<gl>, {|o| Trim(Upper(o:name)) == <cName>})
-
- FUNCTION gets03
-
- LOCAL nQty := 0
- LOCAL nDiscount := 0
- LOCAL nAccount := 0
-
- CLEAR SCREEN
- @ 10, 10 SAY "Enter Quantity" GET nQty ;
- VALID {|oGet| ResetQty(oGet, GetList), .T.}
- @ 11, 10 SAY "Enter Discount" GET nDiscount WHEN nQty > 10
- @ 12, 10 SAY " Enter A / C #" GET nAccount
- READ
-
- RETURN NIL
-
- FUNCTION ResetQty(oGet, GetList)
-
- LOCAL nGet := GET_NUMBER("NDISCOUNT", GetList)
-
- IF oGet:varGet() <= 10
- GetList[nGet]:varPut(0)
- GetList[nGet]:display()
- ENDIF
-
- RETURN NIL