promptok

Chris Sharman Chris.Sharman@ccagroup.co.uk
Fri, 4 Jun 1999 09:35:53 +0100


>PROCEDURE INPUT PO-QTY
>
>BEGIN
>
>  IF NOT PROMPTOK AND T-QTY-REMAINING > 0
>
>     THEN LET FIELDTEXT = ASCII(T-QTY-REMAINING)
>
>  ELSE
>
>     ERROR "YOU MUST ENTER A QUANTITY"
>
>END

I too test fieldtext, rather than using promptok. But your above code has a
logic error: you set the value if promptok is false AND t-qty-remaining > 0,
but in any other case you error:
	promptok true, t-qty-remaining > 0
	promptok true, t-qty-remaining <= 0
	promptok false, t-qty-remaining <= 0.
Obviously the last of these is the only one you wanted, so the code should be:

 if not promptok
  then if t-qty-remaining > 0
   then let fieldtext = ascii(t-qty-remaining)
   else error "You must enter a quantity"

Chris
______________________________________________________________________
Chris Sharman			Chris.Sharman@CCAgroup.co.uk
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.