Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / The Missing QBASIC STATMENT " DRAW "

Author
Message
ironhoof
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 5th Nov 2002 08:30
Modified for the DB environment I was bored but it has most all of the features including scale and turn angle and turn rotation and it dose work flawlessly. you can practically copy any QB draw statment you ever did to it.

IT DOSNT SUPPORT "paint and move and color" however color isnt nessessary we have INK !

A$="U10BU10U10 NE10 NR10 NF10ND10NG10NL10NH10"

Draw(150,100,A$)

for i=0 to 360 step 10
A$="TA"+str$(I)+"S"+str$(I)+"U10T45U5T45U5T45U10"
Draw(400,300,A$)
next i


end
function Draw(X,Y,Macro$)
Index=1:Angle=0:TMP$=Macro$
MACROFORTH:
IF TMP$="" then ExitFunction
C$=Upper$(MID$(TMP$,Index))$=C$+Upper$(MID$(TMP$,Index+1)):RMV=1
IF C$="U" then HEAD=180
IF C$="R" then HEAD=90
IF C$="D" then HEAD=0
IF C$="L" then HEAD=275
IF C$="F" then HEAD=45
IF C$="G" then HEAD=315
IF C$="E" then HEAD=225
IF C$="H" then HEAD=135
IF C$="N" then NOSHIFT=1
IF C$="B" then NODRAW=1
IF D$="TA" then RMV=2
TMP$=RIGHT$(TMP$,LEN(TMP$)-RMV):BIT=1:NUM$=""
IF C$="N" then goto MACROFORTH:
IF C$=" " then goto MACROFORTH:
IF C$="B" then goto MACROFORTH:
GETVAL:
V$=MID$(TMP$,BIT)
if ASC(V$)>47 and ASC(V$)LEN(TMP$) then goto convert:
goto GETVAL:
convert:
NUMBER=VAL(NUM$):TMP$=RIGHT$(TMP$,LEN(TMP$)-(BIT-1))
IF D$="TA" then ANGLE=NUMBER:GOTO MACROFORTH:
IF C$="T" then ANGLE=WRAPVALUE(ANGLE+NUMBER):GOTO MACROFORTH:
IF C$="S" then SCALE=NUMBER:goto MACROFORTH:
X2=NEWXVALUE(X,ANGLE+HEAD,NUMBER+SCALE)
Y2=NEWZVALUE(Y,ANGLE+HEAD,NUMBER+SCALE)
if NODRAW=0 then Line x,y,x2,y2 else NODRAW=0
if NOSHIFT=0 then X=X2:Y=Y2 else NOSHIFT=0
goto MACROFORTH:
endfunction
-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.
ironhoof
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location:
Posted: 5th Nov 2002 08:33
Lets try that agian...



-----\
There was a man on the stairs that wasn't there.
He wasn't there agian today I think he's from the CIA.

Login to post a reply

Server time is: 2024-04-20 13:42:26
Your offset time is: 2024-04-20 13:42:26