Page 1 of 1

Need help with project please help

Posted: Mon Apr 28, 2008 9:01 pm
by sh
I need to make each line a different color does anyone know how i can change each line a different color instead of green?




DECLARE SUB drawthelines ()
'Programmer:
'Chapter 3 project P.40 #1 4-25-08
'Period 2
SCREEN 7
COLOR 4, 0
CLS

drawthelines
END

SUB drawthelines
'This subprogram draws the lines.

FOR x = 10 TO 240 STEP 40
LINE (0, x)-(320, x), 2
NEXT x

END SUB

Just change the color value

Posted: Mon Apr 28, 2008 10:01 pm
by burger2227
But you are limited to 16 colors from 0 to 15

Syntax: LINE(c1, r1)-(c2, r2), colour, '[box] = B or BF

Ted

Posted: Mon Apr 28, 2008 10:22 pm
by sh
so u are saying just put this code in and it should change the colors??
Syntax: LINE(c1, r1)-(c2, r2), colour, [box]

READ the QB HELP

Posted: Tue Apr 29, 2008 12:08 am
by burger2227
A LINE statement can also create boxes. You don't need B or BF if you just want lines. That was a syntax of the LINE statement.

To change a line color, just increment the value of the variable colour.

Code: Select all


SCREEN 7         'MUST use a screen mode for graphics!
DO
    colour = colour + 1                   'increment color
    r1 = r1 + 5                              'increase rows
    LINE( 100, r1)-(220, r1), colour
    IF colour = 15 THEN colour = 0

LOOP UNTIL r1 > 200