Sub DrawGrid
GraphicsWindow.PenColor = "#CCCCCC"
For y = 0 To gh Step 50
GraphicsWindow.DrawLine(0, y, gw, y)
EndFor
For x = 0 To gw Step 50
GraphicsWindow.DrawLine(x, 0, x, gh)
EndFor
GraphicsWindow.PenColor = "#999999"
For y = 0 To gh Step 100
GraphicsWindow.DrawLine(0, y, gw, y)
GraphicsWindow.DrawText(2, y + 2, y)
EndFor
For x = 0 To gw Step 100
GraphicsWindow.DrawLine(x, 0, x, gh)
GraphicsWindow.DrawText(x + 2, 2, x)
EndFor
EndSub