“Unexpected character” error with strings in GlowScript

24 views
Skip to first unread message

Joe Heafner

unread,
Nov 5, 2017, 6:53:20 PM11/5/17
to GlowScript Users
When I try to run this script, I get an “Unexpected character” error for the string delimiters. It happens regardless of whether I use single, double, or triple quotes. 

http://www.glowscript.org/#/user/heafnerj/folder/Joe'sStuff/program/VisualizeLeviCivita3


This program, which I wrote yesterday and the day before, works perfectly.


I’ve seen this problem before when copying text from one GlowScript window to another. Something happens, at least on Macs and iOS devices (I’m using my iPad Pro right now) that changes something about string delimiter characters. Last year I also saw it happen on Windows systems. The only fix that I know of is to NOT cut and paste text and create the program from scratch. Indeed I copied the code from the second program into the first one to save time, but with this bug it saves no time at all.

Any idea what could happen when cutting and pasting from one GS window to another to cause this error? 


Joe Heafner
Sent from my iPad

Bruce Sherwood

unread,
Nov 5, 2017, 7:48:14 PM11/5/17
to Glowscript Users
I'm unable to see a failure on either an iPad or a Mac. I placed print('x') in a program and ran it. Then I copied the print statement to a different file, and it looked unchanged and ran correctly. Can you say anything more about your tests?

Bruce

Joe Heafner

unread,
Nov 5, 2017, 9:08:21 PM11/5/17
to GlowScript Users
On Nov 5, 2017, at 19:48, Bruce Sherwood <bruce.s...@gmail.com> wrote:
>
> I'm unable to see a failure on either an iPad or a Mac. I placed print('x') in a program and ran it. Then I copied the print statement to a different file, and it looked unchanged and ran correctly. Can you say anything more about your tests?

Aaron and I talked and he thinks it may be a character encoding issue on my iPad. I’m trying to work that possibility. I tend to see obscure things like this all the time; must be me.

Joe Heafner
Sent from one of my Macs



Joe Heafner

unread,
Nov 5, 2017, 9:56:39 PM11/5/17
to glowscri...@googlegroups.com
I just tested everything again and the program runs on all my devices, including my iPhone, EXCEPT my iPad Pro. I see no way to alter any keyboard encoding r anything like that. I’m stumped.


Joe Heafner
Sent from my iPad
On Nov 5, 2017, at 19:48, Bruce Sherwood <bruce.s...@gmail.com> wrote:

I'm unable to see a failure on either an iPad or a Mac. I placed print('x') in a program and ran it. Then I copied the print statement to a different file, and it looked unchanged and ran correctly. Can you say anything more about your tests?

Bruce

--

---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Heafner

unread,
Nov 5, 2017, 10:13:34 PM11/5/17
to glowscri...@googlegroups.com
SOLVED!

I finally found the solution. On the iPad Pro, you must press and hold the single quote key, the one where the single quote is the main character. Enter numeric mode by pressing .?123 and the correct key is just under, and very slightly to the left of, the 8 key. Press and hold the single quote key, and a tiny menu will pop up from which you can select the apostrophe character (just by sliding your fingertip to it) and releasing the key. A similar trick works for getting straight ASCII double quotes from the key just underneath, and slightly to the right of, the 9 key. Note that this solution does NOT work with my Logitech Keys-To-Go Bluetooth keyboard.

Now I can sleep tonight.

Joe Heafner
Sent from my iPad
On Nov 5, 2017, at 19:48, Bruce Sherwood <bruce.s...@gmail.com> wrote:

I'm unable to see a failure on either an iPad or a Mac. I placed print('x') in a program and ran it. Then I copied the print statement to a different file, and it looked unchanged and ran correctly. Can you say anything more about your tests?

Bruce

--
Reply all
Reply to author
Forward
0 new messages