Author Topic: How to avoid scrolling when printing at last 2 lines?  (Read 3207 times)

0 Members and 1 Guest are viewing this topic.

Offline FilipeEstima

  • Newbie
  • Posts: 63
    • View Profile
How to avoid scrolling when printing at last 2 lines?
« on: September 09, 2020, 03:15:17 pm »
I need to understand how I can print at last 2 lines of text without making the text to scroll upwards. Whenever I try to print at line 24 or 25, everything is scrolled up. I can't get text to stay at line 24, but at line 25 it's possible - however scroll happens to the other lines.

Code: [Select]
FOR t = 1 TO 22: LOCATE t, 1: PRINT t: NEXT t
SLEEP
LOCATE 23, 1: PRINT 23
SLEEP
LOCATE 24, 1: PRINT 24
SLEEP
LOCATE 25, 1: PRINT 25
SLEEP

Edit: OK, I found out at the VIEW PRINT command explanation at the wiki http://qb64.org/wiki/VIEW_PRINT

Quote
Note: The bottom row of the VIEW PRINT port can be used only when located or prints end with semicolons.

Back to coding :)
« Last Edit: September 09, 2020, 03:19:52 pm by FilipeEstima »

Marked as best answer by FilipeEstima on September 09, 2020, 11:21:03 am

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: How to avoid scrolling when printing at last 2 lines?
« Reply #1 on: September 09, 2020, 03:18:35 pm »
Make Friends with semi-colon! :)
Code: QB64: [Select]
  1. FOR t = 1 TO 22: LOCATE t, 1: PRINT t: NEXT t
  2. LOCATE 23, 1: PRINT 23;
  3. LOCATE 24, 1: PRINT 24;
  4. LOCATE 25, 1: PRINT 25;
  5.  

Offline FilipeEstima

  • Newbie
  • Posts: 63
    • View Profile
Re: How to avoid scrolling when printing at last 2 lines?
« Reply #2 on: September 09, 2020, 03:20:28 pm »
Yes bplus, thanks for confirming my discovery :p

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: How to avoid scrolling when printing at last 2 lines?
« Reply #3 on: September 10, 2020, 06:16:05 pm »
Yes you boys are right
wiki says the same of you here https://www.qb64.org/wiki/index.php/PRINT
Programming isn't difficult, only it's  consuming time and coffee