Post by honkytonk on Dec 30, 2018 11:56:16 GMT
Hello, how to make the pencil does not start from zero and do not come back zero at the end, or when it does not show?
Thank you.
Thank you.
' Click and move; click on "Dec" (divide datas); clixk on "Draw back"
' adjust val of Dec
NOMAINWIN
WindowWidth = 600: WindowHeight = 400
UpperLeftX = (DisplayWidth-WindowWidth)-200
UpperLeftY = 20 ' (DisplayHeight-WindowHeight)
BUTTON #w.net, "Dec", [dec], UL, 110, 20, 40, 20
TEXTBOX #w.b, 20 , 20, 80, 25
TEXTBOX #w.da, 20 , 75, 80, 25
TEXTBOX #w.db, 170 , 20, 80, 25
BUTTON #w.go, "Draw back ", [drawback], UL, 280, 20, 80, 20
GRAPHICBOX #w.m 5, 5, 585, 360
OPEN "Test" FOR window_nf AS #w
#w, "TRAPCLOSE [closetest]"
#w.m "down;fill darkgreen; color white;backcolor darkgreen"
#w.m, "when leftButtonMove [move]"
#w.m, "size 2"
x$="":y$="": s=2
#w.b, str$(s)
#w.m, "place 20 60": #w.m, "\ N Data": #w.m, "place 20 340": #w.m, "\ Click and Move"
#w.go, "!disable"
[move]
x=MouseX: y= MouseY
#w.m, "set ";x;" ";y
p=p+1 ' : tr(1,p)=x: tr(2,p)=y
x$=x$+str$(x)+" ": y$=y$+str$(y)+" "
#w.da, str$(p)
wait
[dec]
for c=1 to len(x$) 'end of array
cont=cont+1
if word$(x$,c)="" then exit for
next c
#w.da, str$(cont)
dim tx$(2,cont+1)
#w.b, "!contents? var$": s=val(var$)
for c=1 to cont step s ' keep one all s
pl=pl+1
tx$(1,pl)=tx$(1,pl)+word$(x$,c)+" "
tx$(2,pl)=tx$(2,pl)+word$(y$,c)+" "
next c
#w.db, str$(pl): #w.go, "!enable"
wait
[drawback]
#w.m "down;fill darkblue; color yellow;backcolor darkblue"
' #w.m, "go ";val(tx$(1,1));" ";val(tx$(2,1)) 'no good
for tra=1 to pl
' if val(tx$(1,tra))=0 or val(tx$(2,tra))=0 then tra=tra+1 'no good
#w.m, "goto ";val(tx$(1,tra));" ";val(tx$(2,tra))
next tra
wait
[closetest]
CLOSE #w
END