loading
 
vbscript error
Anonymous
15 year
I've used the vbscript to manipulate my variables and then later set a variable, but I can't see it in the variable list using watch variables. And also there is an error in the message box, here is my code including the error:

orange_flagDIST = GetVariable("orange_flagDIST")
orange_flagANGLE = GetVariable("orange_flagANGLE")
robot_flagDIST = GetVariable("robot_flag_distance")
robot_flagANGLE = GetVariable("robot_flagANGLE")

if orange_flagDIST < robot_flagDIST then
  move = 4
  else
    if orange_flagDIST > robot_flagDIST then
      if (orange_flagANGLE-robot_flagANGLE) > 1 then
        move = 5
        else
          if (robot_flagANGLE-orange_flagANGLE) > 1 then
            move = 4
          end if
      end if
    end if
end if

SetVariable "robotMOVE", move

error (21) : Expected end of statement

thanks,
lonemangx
Anonymous 15 year
Actually your code is fine. You probably just need to press the Reload and Run button in the VBScript module in order to reparse and start executing the code. That error was probably left from an earlier error. Note that the VBScript module will NOT start running the code as you type it in but will wait for the Reload button to be pressed before accepting the new code.

Can you give that a quick try and let us know if that solves the issue?

Thanks,
STeven.
Homer M. Manalo from Philippines  [3 posts] 15 year
I tried reloading it many times and the error is still there. For now I have resorted to the API, it works and its more flexible than the vbscript extension.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index