"Error true is a reserved word."

255 views
Skip to first unread message

Scott Pflaumer

unread,
Jan 12, 2017, 4:38:25 PM1/12/17
to Glowscript Users
For many of my programs I use a continuously running while loop something like this:

while true:
    ball.pos = ball.pos+velocity*deltat

Ever since either Glowscript 2.2 or 2.3 or so I have started getting an error message: 

"Error true is a reserved word." 

If I put in a different true condition or use an older version of Glowscript then my code works fine. There is probably a simple reason for this but I'm mostly self taught. Can anyone explain why this is happening? 

Thanks,
-Scott


Bruce Sherwood

unread,
Jan 12, 2017, 4:54:36 PM1/12/17
to Glowscript Users
It's subtle. What's different about version 2.3 is that I updated the Python-to-JavaScript transpiler from RapydScript to RapydScript-NG, which comes closer to standard Python and which is more picky about doing so. In particular, in Python the names are True and False, not true and false. So just change true to True. An advantage of this pickiness is that a GlowScript VPython program with True and False will run in true Python in the Jupyter notebook setting.

Scott Pflaumer

unread,
Jan 13, 2017, 11:52:17 AM1/13/17
to Glowscript Users
Thank you - that makes sense. 
Reply all
Reply to author
Forward
0 new messages