Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DRAW sequence m option
#1
Can someone please elaborate a bit on the m x,y (and its related +/- options)  in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc?  Confused
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#2
It's okay, I thought I'd tried everything and had error every time. Turns out I hadn't specified screen mode so I was in screen 0, so no graphics.
Still, I wouldn't mind a bit of tutoring in draw. Maybe "word-of-the-day" will cover this one day.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#3
(11-14-2022, 08:47 AM)PhilOfPerth Wrote: Can someone please elaborate a bit on the m x,y (and its related +/- options)  in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc?  Confused

DRAW, varmint!

Schooled by Sam, who only uses a drawstring to hold up his pants.
Reply
#4
(11-14-2022, 08:47 AM)PhilOfPerth Wrote: Can someone please elaborate a bit on the m x,y (and its related +/- options)  in the draw command? It doesn't get a mention (that I can find) in the Help file, and the Wiki one is pretty unclear. How is it fitted into a draw string, and does it need parentheses, or commas etc?  Confused
You use "M" when the "turtle graphics" commands like "U", "R" and "H" aren't good enough and/or you're not interested in using "S" scale or "TA" change drawing angle which might generate more confusion. "M+2,+2" moves from the "current position" to the position two pixels across and two pixels down, toward your right-hand side of the screen and toward the bottom. It becomes the new current position. "M400,300", without any signs moves absolutely, in this case to the "middle" point of 800x600 screen. This could be combined with "B", in which case there is nothing drawn, or with "N", in which the "current position" is not changed after the "M" command is performed. For example, "M400,300 NM500,300 NM400,150" draws a horizontal line then an upper vertical line, while the "current position" remains the middle of your 800x600 screen.
Reply
#5
Hi Phil - been a while since I've seen this draw string stuff but if I'm remembering correctly that M need you to input the co-ordinates x,y. I think the command works like this

DRAW "M+"+ the string value of the co-ordinates you want the drawing to move to. At least I think that's the way it was supposed to go.
Reply
#6
Well lookie here, I drews a box!

Now I'z can see the poorade!

Code: (Select All)
DRAW "d80"
DRAW "r80"
DRAW "u80"
DRAW "l80"

- Sam
Reply
#7
No Phil - I think I'm wrong on that - seems to me the fact the co-ordinates are in quotes already makes them string values so Draw "M3,4" is already a string value. I was originally thinking it worked like Draw "M+"+str$(3)+str$(4)

Doesn't this exercise remind you of the song "Dancing in the Dark"?
Reply
#8
Springsteen sucks! <robots-follow>

Pete
Reply
#9
(11-14-2022, 05:47 PM)Dimster Wrote: Doesn't this exercise remind you of the song "Dancing in the Dark"?
Which one, by Bruce Springsteen?

You're confusing other people, there's no need to use "STR$()" unless you need to take the value of a numeric variable. Also within "M" statement for "DRAW" command, use signs only for relative move which is like "U" or "H" but could be fancier because those single-letter commands only do "straight" moves, in one direction or in diagonal. Using "M+4,+3" is line using "STEP" in some of the graphics commands like "LINE" and "PSET". You don't use signs when you want to move absolutely, as in the coordinates to give "PSET" (without "STEP" and without signs unless you're under the influence of "WINDOW"). Ah shucks I'm only causing even more confusion!
Reply
#10
It's surprising that some developer of QBasic went to the trouble of advancing DRAW into a macro language, but never really documented it worth a damn. That stated, I swear, I never worked for M$. As stated, using DRAW with M, etc. is like Turtle Graphics, but not compatible, so getting schooled in TG would only be of some relative help. BTW - I have three books on QuickBASIC and none of them offered any explanation, other than the reference to Turtle Graphics and the macro language built into the DRAW statement. PRINT ABS(crap!)

Pete
Reply




Users browsing this thread: 2 Guest(s)