Post by hcm2011 on Feb 3, 2019 1:49:33 GMT
Hello all. Just started learning just basic today and am running into a problem I can't seem to google my way out of. Attached is my code so far. All the windows and menus work fine but when I close any window the main window closes as well and I get the following error. Any advice would be appreciated.
insert code here
[start.main]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
BackgroundColor$="black"
menu #main, "SIZE", "1X1", [onSIZE1X1], "1X2", [onSIZE1X2], "1X3", [onSIZE1X3], "1X4", [onSIZE1X4], "1X5", [onSIZE1X5], "1X6", [onSIZE1X6], "2X2", [onSIZE2X2], "2X3", [onSIZE2X3], "2X4", [onSIZE2X4], "2X5", [onSIZE2X5], "2X6", [onSIZE2X6], "3X3", [onSIZE3X3], "3X4", [onSIZE3X4], "3X5", [onSIZE3X5], "3X6", [onSIZE3X6], "4X4", [onSIZE4X4], "4X5", [onSIZE4X5], "4X6", [onSIZE4X6], "5X5", [onSIZE5X5], "5X6", [onSIZE5X6], "6X6", [onSIZE6X6]
menu #main, "SAVE", "SAVE", [onSAVESAVE]
menu #main, "RUN", "RUN EASY-PCB CUTTER", [onRUNRUN]
open "EASY-PCB VER1.01" for graphics as #main
print #main, "down; fill black; flush"
print #main, "trapclose [quit.main]"
print #main, "font ms_sans_serif 0 16"
wait
[quit.main]
Close #main
END
[onSIZE1X1]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X1.graphicbox1, ((WindowWidth-116)/2),((WindowHeight-116)/2), 116, 116
open "SIZE 1X1" for graphics as #SIZE1X1
print #SIZE1X1.graphicbox1,"down; fill red; flush"
print #SIZE1X1, "down; fill black; flush"
print #SIZE1X1, "trapclose [quit.SIZE1X1]"
print #SIZE1X1, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X1]
Close #SIZE1X1
END
[onSIZE1X2]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X2.graphicbox1, ((WindowWidth-232)/2),((WindowHeight-116)/2), 232, 116
open "SIZE 1X2" for graphics as #SIZE1X2
print #SIZE1X2.graphicbox1,"down; fill red; flush"
print #SIZE1X2, "down; fill black; flush"
print #SIZE1X2, "trapclose [quit.SIZE1X2]"
print #SIZE1X2, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X2]
Close #SIZE1X2
END
[onSIZE1X3]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X3.graphicbox1, ((WindowWidth-348)/2),((WindowHeight-116)/2), 348, 116
open "SIZE 1X3" for graphics as #SIZE1X3
print #SIZE1X3.graphicbox1,"down; fill red; flush"
print #SIZE1X3, "down; fill black; flush"
print #SIZE1X3, "trapclose [quit.SIZE1X3]"
print #SIZE1X3, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X3]
Close #SIZE1X3
END
[onSIZE1X4]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X4.graphicbox1, ((WindowWidth-464)/2),((WindowHeight-116)/2), 464, 116
open "SIZE 1X4" for graphics as #SIZE1X4
print #SIZE1X4.graphicbox1,"down; fill red; flush"
print #SIZE1X4, "down; fill black; flush"
print #SIZE1X4, "trapclose [quit.SIZE1X4]"
print #SIZE1X4, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X4]
Close #SIZE1X4
END
[onSIZE1X5]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X5.graphicbox1, ((WindowWidth-580)/2),((WindowHeight-116)/2), 580, 116
open "SIZE 1X5" for graphics as #SIZE1X5
print #SIZE1X5.graphicbox1,"down; fill red; flush"
print #SIZE1X5, "down; fill black; flush"
print #SIZE1X5, "trapclose [quit.SIZE1X5]"
print #SIZE1X5, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X5]
Close #SIZE1X5
END
[onSIZE1X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE1X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-116)/2), 696, 116
open "SIZE 1X6" for graphics as #SIZE1X6
print #SIZE1X6.graphicbox1,"down; fill red; flush"
print #SIZE1X6, "down; fill black; flush"
print #SIZE1X6, "trapclose [quit.SIZE1X6]"
print #SIZE1X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE1X6]
Close #SIZE1X6
END
[onSIZE2X2]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE2X2.graphicbox1, ((WindowWidth-232)/2),((WindowHeight-232)/2), 232, 232
open "SIZE 2X2" for graphics as #SIZE2X2
print #SIZE2X2.graphicbox1,"down; fill red; flush"
print #SIZE2X2, "down; fill black; flush"
print #SIZE2X2, "trapclose [quit.SIZE2X2]"
print #SIZE2X2, "font ms_sans_serif 0 16"
wait
[quit.SIZE2X2]
Close #SIZE2X2
END
[onSIZE2X3]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE2X3.graphicbox1, ((WindowWidth-348)/2),((WindowHeight-232)/2), 348, 232
open "SIZE 2X3" for graphics as #SIZE2X3
print #SIZE2X3.graphicbox1,"down; fill red; flush"
print #SIZE2X3, "down; fill black; flush"
print #SIZE2X3, "trapclose [quit.SIZE2X3]"
print #SIZE2X3, "font ms_sans_serif 0 16"
wait
[quit.SIZE2X3]
Close #SIZE2X3
END
[onSIZE2X4]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE2X4.graphicbox1, ((WindowWidth-464)/2),((WindowHeight-232)/2), 464, 232
open "SIZE 2X4" for graphics as #SIZE2X4
print #SIZE2X4.graphicbox1,"down; fill red; flush"
print #SIZE2X4, "down; fill black; flush"
print #SIZE2X4, "trapclose [quit.SIZE2X4]"
print #SIZE2X4, "font ms_sans_serif 0 16"
wait
[quit.SIZE2X4]
Close #SIZE2X4
END
[onSIZE2X5]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE2X5.graphicbox1, ((WindowWidth-580)/2),((WindowHeight-232)/2), 580, 232
open "SIZE 2X5" for graphics as #SIZE2X5
print #SIZE2X5.graphicbox1,"down; fill red; flush"
print #SIZE2X5, "down; fill black; flush"
print #SIZE2X5, "trapclose [quit.SIZE2X5]"
print #SIZE2X5, "font ms_sans_serif 0 16"
wait
[quit.SIZE2X5]
Close #SIZE2X5
END
[onSIZE2X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE2X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-232)/2), 696, 232
open "SIZE 2X6" for graphics as #SIZE2X6
print #SIZE2X6.graphicbox1,"down; fill red; flush"
print #SIZE2X6, "down; fill black; flush"
print #SIZE2X6, "trapclose [quit.SIZE2X6]"
print #SIZE2X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE2X6]
Close #SIZE2X6
END
[onSIZE3X3]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE3X3.graphicbox1, ((WindowWidth-348)/2),((WindowHeight-348)/2), 348, 348
open "SIZE 3X3" for graphics as #SIZE3X3
print #SIZE3X3.graphicbox1,"down; fill red; flush"
print #SIZE3X3, "down; fill black; flush"
print #SIZE3X3, "trapclose [quit.SIZE3X3]"
print #SIZE3X3, "font ms_sans_serif 0 16"
wait
[quit.SIZE3X3]
Close #SIZE3X3
END
[onSIZE3X4]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE3X4.graphicbox1, ((WindowWidth-464)/2),((WindowHeight-348)/2), 464, 348
open "SIZE 3X4" for graphics as #SIZE3X4
print #SIZE3X4.graphicbox1,"down; fill red; flush"
print #SIZE3X4, "down; fill black; flush"
print #SIZE3X4, "trapclose [quit.SIZE3X4]"
print #SIZE3X4, "font ms_sans_serif 0 16"
wait
[quit.SIZE3X4]
Close #SIZE3X4
END
[onSIZE3X5]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE3X5.graphicbox1, ((WindowWidth-580)/2),((WindowHeight-348)/2), 580, 348
open "SIZE 3X5" for graphics as #SIZE3X5
print #SIZE3X5.graphicbox1,"down; fill red; flush"
print #SIZE3X5, "down; fill black; flush"
print #SIZE3X5, "trapclose [quit.SIZE3X5]"
print #SIZE3X5, "font ms_sans_serif 0 16"
wait
[quit.SIZE3X5]
Close #SIZE3X5
END
[onSIZE3X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE3X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-348)/2), 696, 348
open "SIZE 3X6" for graphics as #SIZE3X6
print #SIZE3X6.graphicbox1,"down; fill red; flush"
print #SIZE3X6, "down; fill black; flush"
print #SIZE3X6, "trapclose [quit.SIZE3X6]"
print #SIZE3X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE3X6]
Close #SIZE3X6
END
[onSIZE4X4]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE4X4.graphicbox1, ((WindowWidth-464)/2),((WindowHeight-464)/2), 464, 464
open "SIZE 4X4" for graphics as #SIZE4X4
print #SIZE4X4.graphicbox1,"down; fill red; flush"
print #SIZE4X4, "down; fill black; flush"
print #SIZE4X4, "trapclose [quit.SIZE4X4]"
print #SIZE4X4, "font ms_sans_serif 0 16"
wait
[quit.SIZE4X4]
Close #SIZE4X4
END
[onSIZE4X5]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE4X5.graphicbox1, ((WindowWidth-580)/2),((WindowHeight-464)/2), 580, 464
open "SIZE 4X5" for graphics as #SIZE4X5
print #SIZE4X5.graphicbox1,"down; fill red; flush"
print #SIZE4X5, "down; fill black; flush"
print #SIZE4X5, "trapclose [quit.SIZE4X5]"
print #SIZE4X5, "font ms_sans_serif 0 16"
wait
[quit.SIZE4X5]
Close #SIZE4X5
END
[onSIZE4X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE4X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-464)/2), 696, 464
open "SIZE 4X6" for graphics as #SIZE4X6
print #SIZE4X6.graphicbox1,"down; fill red; flush"
print #SIZE4X6, "down; fill black; flush"
print #SIZE4X6, "trapclose [quit.SIZE4X6]"
print #SIZE4X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE4X6]
Close #SIZE4X6
END
[onSIZE5X5]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE5X5.graphicbox1, ((WindowWidth-580)/2),((WindowHeight-580)/2), 580, 580
open "SIZE 5X5" for graphics as #SIZE5X5
print #SIZE5X5.graphicbox1,"down; fill red; flush"
print #SIZE5X5, "down; fill black; flush"
print #SIZE5X5, "trapclose [quit.SIZE5X5]"
print #SIZE5X5, "font ms_sans_serif 0 16"
wait
[quit.SIZE5X5]
Close #SIZE5X5
END
[onSIZE5X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE5X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-580)/2), 696, 580
open "SIZE 5X6" for graphics as #SIZE5X6
print #SIZE5X6.graphicbox1,"down; fill red; flush"
print #SIZE5X6, "down; fill black; flush"
print #SIZE5X6, "trapclose [quit.SIZE5X6]"
print #SIZE5X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE5X6]
Close #SIZE5X6
END
[onSIZE6X6]
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
BackgroundColor$="black"
graphicbox #SIZE6X6.graphicbox1, ((WindowWidth-696)/2),((WindowHeight-696)/2), 696, 696
open "SIZE 6X6" for graphics as #SIZE6X6
print #SIZE6X6.graphicbox1,"down; fill red; flush"
print #SIZE6X6, "down; fill black; flush"
print #SIZE6X6, "trapclose [quit.SIZE6X6]"
print #SIZE6X6, "font ms_sans_serif 0 16"
wait
[quit.SIZE6X6]
Close #SIZE6X6
END
[onSAVESAVE]
[onRUNRUN]