Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to terminate Loop 1

Status
Not open for further replies.

abbasaif

ISP
Oct 8, 2018
89
0
0
AE
Hi,

Is it possible to terminate the loop, i.e.,

Code:
Select ViewDo
Set Order To Dono
Go Top
Do While ! Eof()
   mDono = Dono
   Seek mDono In ViewDo
   Do While Dono = mDono And ! Eof()
      Scatter Memvar
      Select DoDisp
      Append Blank
      Gather Memvar
      Select ViewDo
      Skip
   Enddo
   Select DoDisp
   Set Order To DoCode
   Go Top
   mstatus = 'Customer Copy'
   Report Form Locfile('\reports\NtDoPrn.frx') Preview
   Select DoDisp
   Zap In DoDisp
   Select ViewDo
Enddo

If the user wants to exit from displaying the report which contains 50+ pages, how he/she can do so after display few pages.

Please advise

Thanks

Abbasaif
 
Put ALL records in the cursor and make a group in the report where the group starts in new page
that way the user can print the report at once and if S/He wants to exit then S/He will just hit ESC.

Borislav Borissov
VFP9 SP2, SQL Server
 
Yes,

Thanks for the idea sharing!

I will check it.

Regards

Abbasaif
 
You may use variations of the following:

push key
on escape wait wind nowa ""
Do While ! Eof() and lastkey()#27
...
enddo
pop key

Best Wishes
 
Besides all that, the command to exit a loop is... EXIT.

But since you never know whether a user canceled or printed from Report Form Locfile('\reports\NtDoPrn.frx') Preview
you never know when to exit.

Indeed putting all output into one single report is much better then, as it only means one exit.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Code:
You may use variations of the following:

push key
on escape wait wind nowa ""
Do While ! Eof() and lastkey()#27
...
enddo
pop key

Thanks Robinov, it is also the best

Regards

Abbasaif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top