Infinite loading screen when embedding single quotes in widget text

13 views
Skip to first unread message

peter varfalvy

unread,
Oct 23, 2022, 7:06:32 PM10/23/22
to Glowscript Users
Hello,

I've come across a bizarre error with an infinite loading screen on both Glowscript and Trinket.io.

Im my code (links after the sample code, below) the single line of code

accelCaptionAng = wtext(text=f" Acceleration's acute angle from centripetal = {phi:.3f}<sup>o</sup>")

is the culprit for some reason. All the other lines of code that have

accelCaptionAng.text = f"...'..."

work fine and display the embedded single quote as the apostrophe it is intended to represent.

So, for some reason, embedding a single quote between double quotes within the first instance of creating a wtext generates the infinite loading loop (but not so in off-line IDLE and command-line versions) while modifying the text via .text = .... allows for the embedded single quote. So changing that first instance of the wtext from the above to

accelCaptionAng = wtext(text=f" Acceleration acute angle from centripetal = {phi:.3f}<sup>o</sup>")

and then immediately following it up with

accelCaption.text=f" Acceleration's acute angle from centripetal = {phi:.3f}<sup>o</sup>"

resolves the issue, but seems bizarre to be needed.



I tried searching the conversations on this group to see if this has been reported before but I failed to find a similar report.

I hope this can help someone else who runs across this issue.

All the best,

Peter Varfalvy


Bruce Sherwood

unread,
Oct 23, 2022, 7:51:48 PM10/23/22
to Glowscript Users
Thanks for this report. As it happens, very recently I Iearned that the same problem occurs with the label object, and preceding the label statement with s = the desired string, and in the label statement saying text=s, got around the problem, which is similar to what you did. It seems very odd that this failure in both label and wtext was never reported until now.

Bruce

peter varfalvy

unread,
Oct 24, 2022, 5:49:50 PM10/24/22
to glowscri...@googlegroups.com
Thanks! I guess very few people use captions that require apostrophes.

Best,


On Sun, 23 Oct 2022 at 19:51, Bruce Sherwood <bruce.s...@gmail.com> wrote:
Thanks for this report. As it happens, very recently I Iearned that the same problem occurs with the label object, and preceding the label statement with s = the desired string, and in the label statement saying text=s, got around the problem, which is similar to what you did. It seems very odd that this failure in both label and wtext was never reported until now.

Bruce

--

---
You received this message because you are subscribed to a topic in the Google Groups "Glowscript Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glowscript-users/ITD7pWbg0eI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/f165f8f9-9676-4473-a82a-7e45d63db935n%40googlegroups.com.


--
“Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”

― Terry Pratchett, Reaper Man

Bruce Sherwood

unread,
Oct 25, 2022, 1:56:03 AM10/25/22
to Glowscript Users
Single quotes (apostrophes) inside double quotes now work properly.

Bruce
Reply all
Reply to author
Forward
0 new messages