See inserted code below.
Also you should look at DECLARE CURSOR as a better way to loop thru a set of
records

Bernie Lis
Megabytes, Inc.
Walled Lake, MI

----- Original Message -----
From: "Ned Ritchie" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, January 11, 2003 8:15 PM
Subject: [RBASE-L] - How can I end a routine gracefully?


> Does anyone have any suggestions on how to end this routine gracefully
> and continue onward?
>
> Does one check:
> Error Codes?
> SQL Codes?
> Preset value in .vConsignor to 0 or something and test if not 0?
>
> Please point me in the right direction.
>
> LABEL NextCheck
> --CLEAR variables
> --and calculate Other stuff here then
> --TEST if there are any checks to be printed
> SELECT CustNumber INTO vConsignor +
>   FROM ConsignView  +
>   WHERE DateSOLD BETWEEN .vBeginDate AND .vEndDate +
>   AND CheckNumber IS NULL +
>   AND Limit = 1

if sqlcode <> 0 then
  clear all var
  return
endif

> --Eventually a point is reached where there are NO rows that qualify
> --and my program just ends ungracefully with uncleared variables
> --However when we have valid data we actually print the next check
> OUTPUT PRINTER
> --PRINT report
> OUTPUT SCREEN
> --and UPDATE stuff here
> GOTO NextCheck
>
> Ned
>
>

Reply via email to