Microsoft Small Basic

Program Listing: RPT809-0
' 2012/09/19 12:06:07 Generated
' by Shapes 1.12
' 9/18/2012 4:37:19 PM Generated
' by Shapes Editor 0.9
'
' initialize shapes
Shapes_Init()
' add shapes
scale = 1
Shapes_Add()
angle = 0

Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 212 ' x offset
shY = 51.000000000000 ' y offset
shape = ""
shape[1] = "func=rect;x=42.516662597656;y=113.800010681153;width=109;height=181;bc=#FF0000;pc=#FF000000;pw=2;"
shape[2] = "func=tri;x=0;y=209.333335876465;x1=32;y1=0;x2=0;y2=74;x3=64;y3=74;angle=26;bc=#FFADAD;pc=#FF000000;pw=2;"
shape[3] = "func=tri;x=132;y=207.333335876465;x1=31;y1=0;x2=0;y2=79;x3=62;y3=79;angle=337;bc=#FFADAD;pc=#FF000000;pw=2;"
shape[4] = "func=line;x=97.366668701172;y=211.900016784668;x1=1.116668701172;y1=0.000000000000;x2=0.000000000000;y2=79.283325195313;pc=#FF000000;pw=2;"
shape[5] = "func=tri;x=62.116668701172;y=293.716667175293;x1=36;y1=0;x2=0;y2=30;x3=72;y3=30;bc=#FFADAD;pc=#FF000000;pw=2;"
shape[6] = "func=tri;x=35.783355712891;y=0.000000000000;x1=62;y1=0;x2=0;y2=115;x3=124;y3=115;bc=#FFADAD;pc=#FF000000;pw=2;"
shape[7] = "func=ell;x=74.116668701172;y=329.283317565918;width=45;height=102;bc=#FF0700;pc=#FF000000;pw=2;"
shape[8] = "func=ell;x=79.233337402344;y=341.333335876465;width=34;height=71;bc=#FF7E07;pc=#FF000000;pw=2;"
shape[9] = "func=ell;x=86.533332824707;y=355.583335876465;width=19;height=42;bc=#FFFF00;pc=#FF000000;pw=2;"
shape[10] = "func=rect;x=33;y=382.333335876465;width=141;height=43;bc=#FFFFFF;pc=#FFFFFF;pw=2;"
EndSub

Sub Shapes_Add
' Shapes | Add shapes as shapes data
' param shape - array of shapes
' param scale - to zoom
' return nShapes - number of shapes
' return shAngle - current angle of shapes
Stack.PushValue("local", i)
Stack.PushValue("local", x)
Stack.PushValue("local", y)
nShapes = Array.GetItemCount(shape)
s = scale
For i = 1 To nShapes
GraphicsWindow.PenWidth = shape[i]["pw"] * s
If shape[i]["pw"] > 0 Then
GraphicsWindow.PenColor = shape[i]["pc"]
EndIf
If shape[i]["func"] = "rect" Then
GraphicsWindow.BrushColor = shape[i]["bc"]
x = shape[i]["x"]
y = shape[i]["y"]
width = shape[i]["width"]
height = shape[i]["height"]
shape[i]["obj"] = Shapes.AddRectangle(width * s, height * s)
Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s)
If shape[i]["angle"] <> 0 Then
Shapes.Rotate(shape[i]["obj"], shape[i]["angle"])
EndIf
ElseIf shape[i]["func"] = "ell" Then
GraphicsWindow.BrushColor = shape[i]["bc"]
x = shape[i]["x"]
y = shape[i]["y"]
width = shape[i]["width"]
height = shape[i]["height"]
shape[i]["obj"] = Shapes.AddEllipse(width * s, height * s)
Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s)
If shape[i]["angle"] <> 0 Then
Shapes.Rotate(shape[i]["obj"], shape[i]["angle"])
EndIf
ElseIf shape[i]["func"] = "tri" Then
GraphicsWindow.BrushColor = shape[i]["bc"]
x = shape[i]["x"]
y = shape[i]["y"]
x1 = shape[i]["x1"]
y1 = shape[i]["y1"]
x2 = shape[i]["x2"]
y2 = shape[i]["y2"]
x3 = shape[i]["x3"]
y3 = shape[i]["y3"]
shape[i]["obj"] = Shapes.AddTriangle(x1 * s, y1 * s, x2 * s, y2 * s, x3 * s, y3 * s)
Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s)
If shape[i]["angle"] <> 0 Then
Shapes.Rotate(shape[i]["obj"], shape[i]["angle"])
EndIf
ElseIf shape[i]["func"] = "line" Then
x = shape[i]["x"]
y = shape[i]["y"]
x1 = shape[i]["x1"]
y1 = shape[i]["y1"]
x2 = shape[i]["x2"]
y2 = shape[i]["y2"]
shape[i]["obj"] = Shapes.AddLine(x1 * s, y1 * s, x2 * s, y2 * s)
Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s)
EndIf
shape[i]["rx"] = x
shape[i]["ry"] = y
EndFor
shAngle = 0
y = Stack.PopValue("local")
x = Stack.PopValue("local")
i = Stack.PopValue("local")
EndSub