COLOR with Border?

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
Theta
Newbie
Posts: 2
Joined: Tue Apr 14, 2009 12:14 pm

COLOR with Border?

Post by Theta » Tue May 15, 2012 7:55 pm

So I was taking a look at some of the functions in the QBasic's help file and found out that you can (Supposedly) set a border color with QBasic?s border color while in Screen Mode 0.

For fun, I thought I try it out and see how it behaved. I tried just a simple COLOR at first, nothing happened. I tried combining it with CLS, and still nothing.

So my question is, is there any actual way to use the border parameter with the COLOR statement? I am just curious is all.

One side question (I'll post this in another topic if you want me too), who would I go about contacting about getting my E-mail changed? The one in my profile no longer works and changing it on PHPBB2 locks you out till you confirm it (or it does on new versions), which I cannot if that e-mail is no longer mine (Simply put I locked my self out of Gmail and they won't give it back).

User avatar
burger2227
Veteran
Posts: 2373
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 » Wed May 16, 2012 1:43 am

The border is no longer supported on monitors. You could use a graphics screen mode such as 12 and

Code: Select all

SCREEN 12
colour = 12
LINE(0, 0)-(639, 479), colour, B 
SLEEP
END
to imitate it. You can't use LINE in SCREEN 0, but you can PRINT ASCII characters above 128 to make a text border.

Code: Select all

Border 12
SLEEP
END

SUB Border (clr%)
COLOR clr%
FOR row = 1 TO 25
  LOCATE row, 1: PRINT CHR$(179);
  LOCATE row, 80: PRINT CHR$(179);
NEXT row

LOCATE 1, 1: PRINT STRING$(80, 196);
LOCATE 25, 1: PRINT STRING$(80, 196);

LOCATE 1, 1: PRINT CHR$(218);
LOCATE 1, 80: PRINT CHR$(191);
LOCATE 25, 1: PRINT CHR$(192);
LOCATE 25, 80: PRINT CHR$(217);
END SUB
To change your email address here, use the Profile link at top of forum page after you have signed in. You can change it there. You must confirm your current password if you wish to change it or alter your e-mail address
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0

Theta
Newbie
Posts: 2
Joined: Tue Apr 14, 2009 12:14 pm

Post by Theta » Wed May 16, 2012 7:45 am

Ah okay. I was just curious why the border parameter never did anything. Thanks for the information!

Also, if anyone wants to know the out come of changing my e-mail. It turns out I did not need to confirm my old address at all (Thank god, since I'm locked out of it) just that my password was correct.

Thanks for all the help, burger2227!

OPRESION
Veteran
Posts: 61
Joined: Tue Jan 16, 2007 4:15 am
Location: Mexico

AN INTERRUPT

Post by OPRESION » Fri Jun 08, 2012 1:23 am

The border options of the color statement were
made for the cga monitors. I did like them because
one was able to make flashing screen border colors
like a warning.

Today I use an old vga and it's not useful for
me, but there is an option to make appear a
screen border color; I use an interrupt
taken from the ABC files. This is the code:

Code: Select all

' Subject: CHANGE COLOR OF SCREEN BORDER      Date: 09-14-97 (21:42)
'  Author: Tommi Utriainen                    Code: QB, PDS
'  Origin: tomppa@pcuf.fi                   Packet: INTERRPT.ABC
'---------------------------------------------------------------

'$INCLUDE: 'QBX.BI': '<---CHANGE THIS TO QB.BI IF YOU USE QB.45
DIM INREGS AS REGTYPE, OUTREGS AS REGTYPE

'---1001=CHANGES THE BORDER COLOR
'---1101=CHANGES TO SMALL FONT
'---1000=CHANGES THE BACKGROUND

INREGS.AX = &H1001

'100=COLOR 1, 200=COLOR 2, 300=COLOR 3, 400=COLOR 4
'500=COLOR 5, 1400=COLOR 6, 700=COLOR 7
'800=DARKBLUE, 1200=LIGHT GREEN, 1300=ANOTHER GREEN
'600=?, 900=?, 1500=?, 1800=?
'1000=DARK GREEN, 2000=DARK RED, 2400=LIGHT RED
'2500=PINK, 2600=ORANGE, 2700=PINK, 2800=?
'3000=DARK GREEN, '3800=DARK GRAY

INREGS.BX = &H2400: '<---BORDER

CALL INTERRUPT(&H10, INREGS, OUTREGS)

COLOR 11, 0
PRINT STRING$(2000, ".")
I haven't found the interrupt to make flashing the
border colors but I would like to know if you can
see the border color with this code and what type
of monitor you are using. Bye.
MY PAGE: http://Qbasic.phatcode.net" target="_blank
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)

Post Reply