Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in very simple code
#1
Hey im just learning how to use qbasic and i was doing tutorial #2 when I got to....

Screen 13
(x1,y1)-(x2,y2),Color

And when I do this (i put in values) it says ... "Expected: ,"...:roll:

Most of the time it doesnt work but there is some times when it does.

Is there anything I can do about this?

Thanks
Reply
#2
[syntax="QBASIC"]Screen 13
LINE (x1,y1)-(x2,y2), Clr 'isn't color becuase that is a dif command[/syntax]


it expects a , if you put pset isntead but it's line
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
Quote:(x1,y1)-(x2,y2),Color

erm..firstly color is a keyword so u cant use it as a variable. Secondly you need to have a command in front of those co-ordinates. Try this

[syntax="qbasic"]screen 12
line(0, 0)-(639, 479),14 'draws a yellow diagonal across the screen
sleep 2
line(0, 0)-(639, 479), 14, B 'draws a yellow box
sleep 2
line(0, 0)-(639, 479), 14, B, &HFF00 'draws a yellow dashed box
sleep 2
line(0, 0)-(639, 479), 14, B 'draws a yellow filled box
sleep 2[/syntax]

Play around with those statements and have fun learning!

Oracle: why is there an extra line inserted at the end of the code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)