Posts: 649
Threads: 95
Joined: Apr 2022
Reputation:
22
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?
Posts: 649
Threads: 95
Joined: Apr 2022
Reputation:
22
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.
Posts: 2,160
Threads: 222
Joined: Apr 2022
Reputation:
102
11-14-2022, 04:46 PM
(This post was last modified: 11-14-2022, 04:47 PM by Pete.)
(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?
DRAW, varmint!
Schooled by Sam, who only uses a drawstring to hold up his pants.
Posts: 1,587
Threads: 59
Joined: Jul 2022
Reputation:
52
(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? 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.
Posts: 381
Threads: 56
Joined: Apr 2022
Reputation:
13
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.
Posts: 2,160
Threads: 222
Joined: Apr 2022
Reputation:
102
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
Posts: 381
Threads: 56
Joined: Apr 2022
Reputation:
13
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"?
Posts: 2,160
Threads: 222
Joined: Apr 2022
Reputation:
102
Springsteen sucks! <robots-follow>
Pete
Posts: 1,587
Threads: 59
Joined: Jul 2022
Reputation:
52
(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!
Posts: 2,160
Threads: 222
Joined: Apr 2022
Reputation:
102
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
|