Qbasicnews.com

Full Version: Alternative ways of printing text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
What are some other ways to print text on the screen without using PRINT? The program I am making requires the speed to print text in several different places without have to LOCATE the area because that way is too slow.
pictures?
DEF SEG = &HB800

And then POKE X+Y*ScrWidth, chrasciivalue

Actually, I think every second byte is the color value, not sure though.
Quote:Actually, I think every second byte is the color value, not sure though.
Indeed it is. Big Grin
Quote:DEF SEG = &HB800

And then POKE X+Y*ScrWidth, chrasciivalue

Actually, I think every second byte is the color value, not sure though.

In fact it is POKE 2*x + 160*y, charascii and POKE 2*x+1 + 160*y, charattribute.
Is there a way similar to that for printing strings? I need an alterative way of printing because doing LOCATE then PRINT is not applicable in my program. I know theres a method using ASM called FastPrint in Pete's QBasic Site but it is very hard to understand, since the article was written in the 80's.
Once you understand how strings work, you should be able to figure it out on your own how to use that technique. Big Grin
edit: I re-read the original post and see now that the problem is speed.

Out of curiosity, how would LOCATE + PRINT be not applicable in a program? I'm sure it's possible, I just can't think of anything off the top of my head. If you are concerned about relocating the cursor, you can always store the current cursor position and reset them after printing.

*peace*

Meg.
Jotz, are you using Screen 0? If not, DEF SEG = &HB800 wont work.

But screen 0 should be fast enough to use locate: print
I am making a level editing program in SCREEN 0. What I did was make an array of strings for each row. Then whenever a block was placed on the map, it would redraw the row it was on. I added a "draw mode" so that when you move the cursor, it will automatically place the blocks. When I do the draw mode, you can sometimes see the cursor on the left printing the row blink. By the way, I am using FreeBasic, but I don't think that would make much of a difference.

I understand how to POKE text onto the screen. Would it be faster to print each block individually using POKE? Unless there is a way to POKE strings, that would be awesome. Also, the thing I didn't understand was the ASM tutorial on FastPrint:

http://www.petesqbsite.com/sections/tuto...tprint.txt
Pages: 1 2