Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Official Links (https://qb64phoenix.com/forum/forumdisplay.php?fid=16) +--- Forum: Learning Resources and Archives (https://qb64phoenix.com/forum/forumdisplay.php?fid=13) +--- Thread: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 (/showthread.php?tid=3229) |
Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - TempodiBasic - 11-25-2024 Hi friends here I discovered again hot water!!! here the experience about PRINT in SCREEN 0 (standard 80 columns and 25 rows of text) Be calm QB64pe duplicates QB4.5 and Qbasic in this behaviour , so the issue comes from the far past of Qbasic. run the code and enjoy the experience: Code: (Select All)
I repeat that this code (adapted to Qbasic : no instructions _delay and _Title) gives the same result in Qbasic under Dosbox! Well you can see how you can print on the 25th row (the last at the bottom) without going ahead only if you use LOCATE before PRINT ; otherwise you go ahead also if you use PRINT; and you don't go over the 80 characters for row! Why this information is useful? in a Q&A Question: How to print on the last row of text without going ahead? Answer: You must use Locate Lastrow, Column: Print SomethingToPrint; (Be care that Lastcolumn - Column >=LEN(SomeThingToPrint)) [example LOCATE 25,10: PRINT "SomethingLessThanLastColumn" REM 80-10 >= LEN( "SomethingLessThanLastColumn") --> 70>=27 RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - Pete - 11-25-2024 Quit complaining. At least your Prime Minister is a hottie! Think about those poor bastards in France and Canada. QB last line printing was so much fun to deal with back in 1990-something. A real jaw dropper. Locate, using the semi-colon, etc. are all needed tools. Oh and did I mention, your PM is a hottie!? Pete RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - TempodiBasic - 11-25-2024 Hi Pete thanks for feedback here a video on my hottie PM Italian PM by Crozza (Mattarella against Musk) coming back to incongruence between ";" of PRINT and going ahead of printing cursor on the last bottom row of text 1. where do you think to be the mistake? Why a LOCATE can correct the position of printing cursor after the following PRINT operation? 2. do you think that Wiki pages need a correction about ";" and the last printable row of text on the screen? Quote: RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - SMcNeill - 11-25-2024 Quote: RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - SMcNeill - 11-25-2024 Note the very subtle change I've made to your code and run the following: Code: (Select All)
Now, if you look at your first FOR loop, I changed that to only print 24 numbers and not 25. Run it and look closely at what happens to your screen.... If you're at the bottom TWO rows (24 or 25) and PRINT, the screen scrolls up! With your code, you're printing the numbers 1 to 23 on the screen. Then on 24, you're printing 24 and scrolling the screen up a line to see 2 to 24 on the screen. Then on 25, you're printing 25 with a semicolon at the end, which prevents the screen scrolling so you're now seeing 2 to 25 on the screen. It's not on the last line that you're seeing something odd; it's the natural result of printing on EITHER of the last two rows and not ending your print statement with a semicolon to prevent the screen scrolling. It's the exact same behavior as all the way back to GW basic, IIRC, and is certainly the same behavior that QB45 has. Now, with that said, there's also some crappy old legacy method to print on those lines and suddenly change your font from font 16 to font 8, which then gives you 50 lines to text to deal with and not 25. That's intentional as well, as off as that seems to. A lot of this old behavior is just based on the legacy behavior of QB45 and how it performed in the past, so that we can stay compatible with old code. My suggestion for an easy fix? Just swap over to _PrintString or _UPrintString and then you won't have that issue to deal with, with screen scrolling, no matter where you print on your screen. RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - TempodiBasic - 11-26-2024 @Steve thanks for technical information... so scroll up starts at row before the last row! and the correct code to gain the 25th line of text is this Code: (Select All)
it always uses LOCATE!! Ok you suggest to pass to the graphic managing of text... so it is more flexible... do you think that wiki must be corrected? RE: Incongruence between PRINT; and LOCATE+ PRINT; on the 25th row of Screen 0 - Pete - 11-27-2024 Or you could code it this way, but it still requires locate.... Code: (Select All)
Just don't go past the screen height with that one. Oh, did I mention your PM is a hottie? Pete |