The last row, where you can't print anything, where the QB message "Press any key" is displayed.
Is there a way to use it? As in, can I display text there, and how do I do it?
Simple, add a semi-colon to the PRINT.
Like this:
Code:
LOCATE 25, 1
PRINT "Hello";
What Neo wrote is true, however you might want to make sure that, if you're using a VIEW PRINT statement, row 25 is included. Otherwise, you can add all the semi- colons you want, and it won't help at all.
Semi-colons are used to keep what's on the screen at row 25 from scrolling up.(Unless of course, you program it to.)
This is the best solution, it's faster then PRINT and more easily used, for textmode only tho.
Code:
DEFINT A-Z
SUB TextPrint (St$, X, Y, C, Bg)
DEF SEG = &HB800
Offset = (X * 2) + (Y * 160)
FOR I = 1 TO LEN(St$)
Pntr = Pntr + 2
POKE Offset + Pntr, ASC(MID$(St$, I, 1))
POKE Offset + Pntr + 1, Bg * 16 + C
NEXT
END SUB
Quote:Simple, add a semi-colon to the PRINT.
Like this:
Code:
LOCATE 25, 1
PRINT "Hello";
Neo's solution is the simplest.
As dadsherm said the semicolon prevents the normal scroll-up which occurs after a Print command. If you didn't use the semicolon, the "Hello" would end up on line 24 after the scroll-up.
Dadsherm, you're probably right about the View Print, but I don't think he will be using that right now.
BinaryShock, even though your solution probably works, it goes right over the head of most of us. You might a well have posted a solution in assembly language.
*****
I've added some comments to Binary's code (I hope that's okay).
Code:
DEFINT A-Z
SUB TextPrint (St$, X, Y, C, Bg)
'Input: St$: the text to be displayed
' X : The column of the first character
' Y : The row of the first character
' C : The color of the text
' Bg : The background color
DEF SEG = &HB800 ' Set segment address for text mode
Offset = (X * 2) + (Y * 160) ' Address of the first character - 2 bytes
FOR I = 1 TO LEN(St$)
Pntr = Pntr + 2 ' Bytes from Offset to address of current character
POKE Offset + Pntr, ASC(MID$(St$, I, 1)) ' POKE the current character
POKE Offset + Pntr + 1, Bg * 16 + C ' POKE the color for the character
NEXT
END SUB
If I've made any mistakes, please let me know.
[suggestion] It seems to me that this could be a
little more efficient using just Offset (or Pntr) rather than both Offset and Pntr.
Code:
Offset = (X * 2) + (Y * 160)
FOR I = 1 TO LEN(St$)
Offset = Offset + 2
POKE Offset, ASC(MID$(St$, I, 1))
POKE Offset + 1, Bg * 16 + C
NEXT
[/suggestion]
Binary's code works, and it is quite faster than PRINT :lol:
I fixed the offset to
But this isn't quite what I wanted, I want to disable the "Press any key to continue" message. If possible.
Yup, exactly what i wanted :lol:
Thanx a lot, and btw, you can add QB 7.1 to the working list.
Plasma do you want your names in the Credits section of Novix?
Novix dev. page
And Binary, did you write the text poke thing? If so, do you want to be in the credits?
Novix=Fake OS built in QB, dev. time spent: 1.5yrs+
PDS 7.1 = QB 7.1
Sure, my name in lights would be cool