Ned,
I'm assuming that assigning the check number prevents the same
record from printing over and over. Testing sqlCode as Dennis
suggested will work...
You might also try something like this:
Declare C1 Cursor for +
Select CustNumber +
from ConsignView +
order by ... +
where DateSOLD BETWEEN .vBeginDate AND +
.vEndDate AND CheckNumber IS NULL
open C1
While 10 > 1 Then
Fetch c1 into .vCusNum
If sqlCode = 100 Then
Break
EndIf
Print ...
Update ...
EndWhile
Drop cursor C1
Ben Petersen
On 11 Jan 2003, at 17:15, Ned Ritchie wrote:
> 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
> --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
>