Graphic stuff

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Seb McClouth

Graphic stuff

Post by Seb McClouth »

Draw table:

QBinux setup was supposed to build in textmode... But I needed line 24 of my screen (through locate 24,1) already from when I started programming with QBasic I knew this isn't possible.

So took screen 9 and used some GPrint (actually the one by Toshi, I think) Didn't look good in the end.

Moved to screen 12: looks good, drawing math is completly stressfull... so I guess to keep the non-vga users (like there are any) happy, I need to do the thingy in text mode. How can I use line 24 without having my line 1 dissappear and have blank (black) line between 23 and 24?

grtz
Seb
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni »

If you put a semicolon at the end of each PRINT and your lines don't overflow the allowed 80 chars, you should not have unwanted scrolls.
This code does not scroll for me.( I'm in Windows 2000)
It uses an 1 line bufer where everything is copied with LSET and MID$ (to avoid to change its size) before printing it

Code: Select all

B$=SPACE$(80)
t!=TIMER
DO
  COLOR RND+14
  A%=INT(RND*25)+1
  'fill the buffer
  LSET B$=">THIS IS LINE "+STR$(A%)
  MID$(B$,77)="<<<"
  'print it
  LOCATE A%,1
  PRINT b$;
  'slow it down!
  DO:LOOP UNTIL TIMER>t!:T!=TIMER
LOOP UNTIL LEN(INKEY$)
Seb McClouth

Post by Seb McClouth »

I program in pure DOS. I had this problem with QBasic and I have it also with QuickBasic.

When I give as a command

Code: Select all

LOCATE 25, 1: PRINT "Hello"
It says in screen 0, that it can't find the line (I get that) but when
in screen 9 or 12 it does what I said in my first post.

grtz
Seb
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni »

I have had problems with line 25 scrolling, but I never had that line 25 not found you have.I have not used pure DOS since 1995...

What happens if you issue a WIDTH 80,25 before printing?
Seb McClouth

Post by Seb McClouth »

Basically the same. But I'll try your code.

So I should be able to use this with your explaining:

Code: Select all

Locate 24,1:?" <Tab>/<Alt-tab>"
Correct?

grtz
Seb
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni »

this works for me:

Code: Select all

width 80,25
Locate 23,1:?" <Tab>/<Alt-tab>";
Locate 24,1:?" <Tab>/<Alt-tab>";
Locate 25,1:?" <Tab>/<Alt-tab>";
No room between the 3 lines, and the bottom line is in the border of the screen. Just gave a semicolon after each print and never go beyond col 80, this is what my buffer method does.
User avatar
SebMcClouth
Veteran
Posts: 240
Joined: Fri Apr 29, 2005 2:20 am
Location: Inside the Matrix

Post by SebMcClouth »

Marvelous!!

Thanks for the hint!!

grtz
Seb
I know why you're here. I know what you've been doing... why you hardly sleep, why you live alone, and why night after night, you sit by your computer...<br>
Unfortunately, no one can be told what Qbinux is. You have to see it for yourself.
User avatar
Xerol
Veteran
Posts: 81
Joined: Tue Jan 04, 2005 6:27 pm
Location: Timonium, MD
Contact:

Post by Xerol »

Believe it or not, there's a slight holdover from GWBasic still in QBasic. If anyone remembers GW, there was the line of 'hotkeys' at the bottom. "KEY OFF" at the beginning of the program would turn that display off and allow you to PRINT to that line. This also fixes the line 25 scrolling problem in QB.
If you need music composed in MP3, WAV, or MIDI format, please contact me via email.

Xerol's Music - Updated Regularly!
Post Reply