on error goto [Error]
dim info$(10,10)
DIM li$(100)'
global adnote
global lstat
global cstat
global bstat
global constx'
global consty
global consth
global constv
global errstate$
global lin
global ideloc
global r
global g
global b
bmpbutton #h.red, "bmp\redbttn.bmp",redclicked, UR,10,10
bmpbutton #h.blue, "bmp\bluebttn.bmp",blueclicked , UR, 10,130
bmpbutton #h.green, "bmp\grnbttn.bmp",greenclicked, UR, 10,70
bmpbutton #h.mred, "bmp\blank5.bmp",mredclicked, UR, 10,40
bmpbutton #h.mblue, "bmp\blank4.bmp",mblueclicked, UR, 10,160
bmpbutton #h.mgreen, "bmp\blank3.bmp",mgreenclicked, UR, 10,100
bmpbutton #h.all, "bmp\grphbttn.bmp",allclicked, UR, 100,160
bmpbutton #h.minusall, "bmp\sqrbttn.bmp",minusallclicked, UR, 130, 160
bmpbutton #h.load,"bmp\OPEN.bmp",[loadit],UR 10,200
bmpbutton #h.save,"bmp\SAVE.bmp",[saveit],UR 10,230
bmpbutton #h.compile,"bmp\xxRun.bmp",[compileit],UR 10,260
bmpbutton #h.helpmsg,"bmp\help.bmp",[HELPME],LL 950,50
bmpbutton #h.lined,"bmp\LINEBTTN.bmp",[linedra],LL 950,100
bmpbutton #h.circd,"bmp\CIRCBTTN.bmp",[circledra],LL 980,100
bmpbutton #h.sqared,"bmp\SQRBTTN.bmp",[squaredraw],LL 1010,100
bmpbutton #h.add,"bmp\ADDBTTN.bmp",[addit],LL 980,140
lin =0
r=50
g=50
b=50
call screen 1200,600
#h.4 "cls;place 10 30;down;backcolor 120 130 125;color white;fill 120 130 125"
#h.4 "\ Click on the ? to get helpful hints-"
errstate$="no"
gcolor$="white"
#h.2, "down;place 10 40;color blue;\";li$(lin);"_"
#h.3 "down;color 140 75 145;backcolor black;place 10 330"
#h.3 "\Hold Left or Right Mouse Button"
#h.3 "place 10 350;\to get a location (needs movement)"
#h.3 "color green;place 150 215;\LOAD"
#h.3 "place 150 245;\SAVE"
#h.3 "place 145 275;\COMPILE"
scan
#h.1 "when leftButtonMove [mouseloc]"
#h.1 "when rightButtonMove [rmouseloc]"
#h.2 "setfocus;place 10 20"
#h.2 "when characterInput [inp]"
[back]
if adnote=1 then adnote=0: call runit
wait
[quit]'
timer 0
#h.1 "discard"
close #h
end
[addit]
txt$=currdraw$
adnote=1
goto [inp]
[linedra]
if lstat=0 then lstat=1 else lstat=0
if lstat=1 then cstat=0:bstat=0
goto [back]
[circledra]
if cstat=0 then cstat=1 else cstat=0
if cstat=1 then lstat=0:bstat=0
goto [back]
[squaredraw]
if bstat=0 then bstat=1 else bstat=0
if bstat=1 then lstat=0:cstat=0
goto [back]
[HELPME]
#h.4 "cls;place 10 30;down;backcolor 120 130 125;color white;fill 120 130 125"
if hmn> 8 then hmn=0
if hmn=0 then #h.4 "\Type commands like: down;color green;line 100 100 200 200;circle 100"
if hmn=1 then #h.4 "\ USE ARROW KEYS TO SCROLL UP AND DOWN THE EDITOR-"
if hmn=2 then #h.4 "\<ENTER> does a line return and auto runs and updates draw."
if hmn=3 then #h.4 "\ Dont forget to type 'down' at the start of your code and dont forget a 'color'"
if hmn=4 then #h.4 "\ Use your Left Mouse Button activate areas you need to use"
if hmn=5 then #h.4 "\ When you click COMPILE it saves to 'A draw in basic.bas'"
if hmn=6 then #h.4 "\ When you click on SAVE it saves to 'A Notbasic.bas'"
if hmn=7 then #h.4 "\ The COMPILER makes draws with #h.1 on each line. Make your graphics box same"
if hmn=8 then #h.4 "\ the semicolon can separate many commands: 'backcolor green;fill green;cls'"
hmn=hmn+1
goto [back]
[Error]'
notice "YOUR ERROR IS: ";li$(lin);"..Try again "
' empty the string so its no longer an error
txt$=""
li$(lin)=""
errstate$="yes"
Resume
end
[mouseloc]
#h.3 "down;color black;backcolor black;place 10 310"
#h.3 "\Left click was at ";constx;",";consty
#h.3 "down;color white;backcolor black;place 10 310"
constx= MouseX
consty= MouseY
call runit
#h.3 "\Left click was at ";constx;",";consty
if lstat=1 then currdraw$= "line "+str$(constx)+" "+str$(consty)+" "+str$(consth)+" "+str$(constv)
if bstat=1 then currdraw$= "line "+str$(constx)+" "+str$(consty)+" "+str$(consth)+" "+str$(consty)+";"+"line "+str$(consth)+" "+str$(consty)+" "+str$(consth)+" "+str$(constv)+";line "+str$(consth)+" "+str$(constv)+" "+str$(constx)+" "+str$(constv)+";line "+str$(constx)+" "+str$(constv)+" "+str$(constx)+" "+str$(consty)
if cstat=1 then currdraw$= "place "+str$(constx)+" "+str$(consty)+";ellipse "+str$(consth)+" "+str$(constv)
print #h.1, "down;color white;";currdraw$
goto [back]
[rmouseloc]
#h.3 "down;color black;backcolor black;place 10 290"
#h.3 "\Right click was at ";consth;",";constv
#h.3 "down;color white;backcolor black;place 10 290"
consth= MouseX
constv= MouseY
call runit
#h.3 "\Right click was at ";consth;",";constv
if lstat=1 then currdraw$= "line "+str$(constx)+" "+str$(consty)+" "+str$(consth)+" "+str$(constv)
if bstat=1 then currdraw$= "line "+str$(constx)+" "+str$(consty)+" "+str$(consth)+" "+str$(consty)+";"+"line "+str$(consth)+" "+str$(consty)+" "+str$(consth)+" "+str$(constv)+";line "+str$(consth)+" "+str$(constv)+" "+str$(constx)+" "+str$(constv)+";line "+str$(constx)+" "+str$(constv)+" "+str$(constx)+" "+str$(consty)
if cstat=1 then currdraw$= "place "+str$(constx)+" "+str$(consty)+";ellipse "+str$(consth)+" "+str$(constv)
print #h.1, "down;color white;";currdraw$
goto [back]
[compileit]
gfile$="A draw in basic.bas"
poz=0'
open gfile$ for output as #fil
while li$(poz)<>""
thestring$= li$(poz)
print #fil, "#h.1 ";chr$(34);thestring$;chr$(34)
poz=poz+1
wend
close #fil
goto [back]
end
[loadit]
gfile$="A Notbasic.bas"
poz=0'temporary variable for increment for array
REDIM li$(100)
if fileExists(DefaultDir$, "A Notbasic.bas") then
open gfile$ for input as #fil
while eof(#fil) > -1
input #fil, thestring$
li$(poz)=thestring$
poz=poz+1
wend
close #fil
else
fexists$=""
end if
txt$=li$(0)
call runit
goto [inp]
end
function fileExists(path$, filename$)
'dimension the array info$( at the beginning of your program
files path$, filename$, info$()
fileExists = val(info$(0, 0)) 'non zero is true
end function
[saveit]
gfile$="A Notbasic.bas"
poz=0' temporary variable for increment for array
open gfile$ for output as #fil
while li$(poz)<>""
thestring$= li$(poz)
print #fil, thestring$
poz=poz+1
wend
close #fil
goto [back]
end
[inp]'
ch$ = Inkey$
#h.2 "down;backcolor 180 180 180;fill 180 180 180;color blue"'
c2$=left$(ch$, 1)
if asc(ch$) >32 and asc(ch$)<127 then txt$=txt$+ch$
if ch$=" " then txt$=txt$+" "
if asc(ch$) =8 then sl= len(txt$)-1:s1$= mid$(txt$,1,len(txt$)-1):txt$= s1$:#h.2 "cls"
if len(Inkey$)>1 then
key1$=right$(Inkey$,1)
key2$=left$(Inkey$,1)
else
key1$=Inkey$
key2$=""
end if
' print len(Inkey$),
if key2$="" then print " ", else print asc(key2$),
ch=asc(key1$)
#h.2 "backcolor 150 150 150;fill 180 180 180 ;cls;color blue"
if asc(ch$)= 13 then call runit'
lpos0$= str$(lin-1)+" "
lpos1$= str$(lin)+" "
lpos2$= str$(lin+1)+" "
if lin>0 then print #h.2, "place 10 20;\";lpos0$;"";li$(lin-1)
#h.2, "place 10 40;\";lpos1$;"";li$(lin);"_"
if lin<500 then print #h.2, "place 10 60;\";lpos2$;"";li$(lin+1)
li$(lin)=txt$ ' this line will make issues if it is active
if ch=37 then curs=curs-1
if ch=39 then curs=curs+1
if ch=38 then lin=lin-1
if lin<0 then lin=0
if ch=40 then lin=lin+1
if ch$="(" then lin=lin-1
if asc(ch$) =13 then if errstate$="no" then lin=lin+1
if errstate$="yes" then errstate$="no"
if lin>100 then lin=100'
lpos0$= str$(lin-1)+" "
lpos1$= str$(lin)+" "
lpos2$= str$(lin+1)+" "
txt$=li$(lin)
#h.2 "backcolor 180 180 180;fill 180 180 180;cls"'<<<<<<<<<<<<<<<<<<<<TEXT
if lin>0 then print #h.2, "place 10 20;\";lpos0$;"";li$(lin-1)
#h.2, "place 10 40;\";lpos1$;"";li$(lin);"_"
if lin<100 then print #h.2, "place 10 60;\";lpos2$;"";li$(lin+1)
'**************************
goto [back]
wait
sub runit
tl=0
#h.1 "place 0 0;down;cls"
[cyclerun]
if len(li$(tl))=0 then goto [getout]
#h.1 "down;";li$(tl)
tl=tl+1
goto [cyclerun]
[getout]
end sub
'
sub allclicked bttnHandle$
r=r+5
g=g+5
b=b+5
if r>255 then r=0
if g>255 then g=0
if b>255 then b=0
call mixedcolor
end sub
sub minusallclicked bttnHandle$
r=r-5
g=g-5
b=b-5
if r < 0 then r=255
if g < 0 then g=255
if b < 0 then b=255
call mixedcolor
end sub
sub redclicked bttnHandle$
r=r+5
if r > 255 then r=0
call mixedcolor
end sub
sub blueclicked bttnHandle$
b=b+5
if b > 255 then b=0
call mixedcolor
end sub
sub greenclicked bttnHandle$
g=g+5
if g >255 then g=0
call mixedcolor
end sub
sub mgreenclicked bttnHandle$
g=g-5
if g<0 then g=255
call mixedcolor
end sub
sub mblueclicked bttnHandle$
b=b-5
if b<0 then b=255
call mixedcolor
end sub
sub mredclicked bttnHandle$
r=r-5
if r<0 then r=255
call mixedcolor
end sub
sub mixedcolor
#h.3 "flush"
#h.3 "place 120 80"
#h.3 "down"
rgb$= str$(r)+" "+str$(g)+" "+str$(b)
#h.3 "color ";r;" ";g;" ";b
#h.3 "backcolor "; rgb$
#h.3 "ellipsefilled 100 100"
#h.3 "place 10 10"
#h.3 " color white"
#h.3 " backcolor black"
#h.3 "\The colors are ";r;" ";g;" ";b;"***"
#h.3 "flush"
end sub
'
sub screen x,y
nomainwin
WindowWidth=x
WindowHeight=y
UpperLeftX=1
UpperLeftY=1
global ch$
global txt$
global name$
global name1$
global getsizeh'
global getsizev
graphicbox #h.1, 0,0,949,450
graphicbox #h.2, 0,500,1200,600
graphicbox #h.3, 950,1,1200,450
graphicbox #h.4, 0,451,949,499
open "THE FIRST REAL TIME GRAPHICS IDE (USE MOUSE LEFT/RIGHT BUTTON TO CLICK ON WORK AREAS TO MAKE THEM WORK" for window_nf as #h
print #h, "trapclose [quit]"
print #h.1, "down;backcolor black;fill black"
print #h.2, "down;backcolor black;fill 180 180 180"
print #h.3, "down;backcolor black;fill black"
print #h.4, "down;backcolor black;fill 120 130 125"
end sub