Delphi I Repeat Until does not work
I am using Delphi I with Window 95.
I am having trouble with a Repeat Until not working after I added a Try
Except.
This routine does work when I remove the try with except.
This routine is used to print checks using dos printing.
The reason that I added the try with except is to give a better message when
the user leaves the printer in off-line mode and gets an error. The message
it was giving was "file access denied".
With HBName^[NaIdx] do {10611}
begin {10611}
WStr := #27 + #67 + chr(CTQPrtLng-1);
{10611}
for i := 1 to 1 do {10611}
begin {10611}
try {11849}
WriteLn(Lst,WStr); {10611}
Here is the Try with Except
except {11849}
on EInOutError do {11849}
begin {11849}
ShowMessage('Printer is not ready. Check will not ' + {11849}
'print. Ready printer and reverse ' + {11849}
'transaction, and repost.'); {11849}
Screen.Cursor := crDefault; {11849}
exit; {11849}
end;
end; {11849}
WStr := ''; {10611}
end; {10611}
{10611}
repeat {start of processing transactions}
Here is the Start of repeat
XX := XX + 1; {10611}
with STran^[XX] do {10611}
begin {10611}
if SCode = '' then {10611}
goto EndOfTrans1; {10611}
if SCode = 'G-D0' then {11044}
begin {11044}
Val(SAmt1,WReal,WReal1); {11044}
WReal := WReal * 0.01; {11044}
if cashback > 0 then {11044}
else {11044}
WkChkAmt := WkChkAmt + WReal; {11044}
end;
... More code in this area
If Counter = 8 then {11044}
begin {11044}
WkChkAmt := 0; {11044}
goto EndOfTrans1; {11044}
end; {11044}
Val(SAmt1,WReal,WReal1); {end of trans for
check}
WReal := WReal * 0.01; {10611}
WkChkAmt := WkChkAmt - WReal; {10611}
if (copy(SCode,1,3) <> 'GBD') then {10611}
if ((copy(Scode,1,3) = 'LAD') and {10611}
(HBActInf^[strtoint(SActIdx)].BAType = 'H')) or {10611}
(copy(Scode,1,3) = 'TDD') then {10611}
else {10611}
begin {10611}
Val(SAmt2,WReal,WReal1); {10611}
WReal := WReal * 0.01; {10611}
WkChkAmt := WkChkAmt + WReal; {10611}
end; {10611}
EndOfTrans1: {10611}
end; {end with STran} {10611}
until (WkChkAmt = 0); {end of trans for
check} Here is the
end of repeat
Thank you for your help.
Rick