Limiting results on screen

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
Limiting results on screen

Post by Guest » Tue Apr 15, 2003 10:25 pm

Please help, I wrote a program and the results are to long to see on the screen. How do I limit the results per page?

User avatar
frankiebaby
Global Moderator
Posts:95
Joined:Tue Apr 30, 2002 1:38 am
Location:Pennsylvania
Contact:

Re: Limiting results on screen

Post by frankiebaby » Wed Apr 16, 2003 1:12 am

i assume the results are printed by line or by variable, IE

For X = 1 to 200
PRINT ARRAY(X)
next

or some such arrangement.

The easiest thing to do is, in SCREEN 0,

For X = 1 to 200
PRINT ARRAY(X)
if X mod 20 = 0 then DO: loop until inkey$ <> ""
&nbsp; &nbsp;   '^this means every 20 lines*

next

* mod, if you are not familiar, returns the remainder of an integer divide, thus 6 mod 4 = 2.  6 / 4 = 1 and 2R

Otherwise, do similar, and use another variable to count how many lines have been printed, then pause as neccesary

Hope this helps :)

Post Reply