This project has moved. For the latest updates, please go here.

AvoidTurtleInHandler

Use
Turtle.Show()
GraphicsWindow.KeyDown = OnKeyDown
While "True"
  If keyDown Then
    If key = "R" Then
      Turtle.TurnRight()
    EndIf
    keyDown = "False"
  Else
    Program.Delay(200)  ' for reducing server load
  EndIf
EndWhile
Sub OnKeyDown
  key = GraphicsWindow.LastKey
  keyDown = "True"
EndSub

instead of
Turtle.Show()
GraphicsWindow.KeyDown = OnKeyDown
Sub OnKeyDown
  If GraphicsWindow.LastKey = "R" Then
    Turtle.TurnRight()
  EndIf
EndSub

Other Resources

Small Basic Known Issue: 25669 - Turtle Operations in Event Handlers Cause Browser Hang Up in Remote (TechNet Wiki)

Last edited Jan 18, 2016 at 5:56 AM by Nonki, version 2