×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to terminate Loop

How to terminate Loop

How to terminate Loop

(OP)
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

RE: How to terminate Loop

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

RE: How to terminate Loop

(OP)
Yes,

Thanks for the idea sharing!

I will check it.

Regards

Abbasaif

RE: How to terminate Loop

(OP)
It is done!

Thanks

Abbasaif

RE: How to terminate Loop

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

RE: How to terminate Loop

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
https://www.doschke.name

RE: How to terminate Loop

(OP)

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close