If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.
Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.
The handler actually runs fine if one does not try to append a return after that line. But I find that oftentimes the SE itself will close after several Cmd-period keypresses. Other times it just unfreezes LC.
The string "*" works fine.
The string "*/" works fine.
The string "*/* shows the issue.
Any random string at all, of any length, if it contains "*/*" somewhere within it, the issue appears.
Bernd, can you explain how a quoted literal of any kind can wreak such havoc in a simple handler? In other words, what is the significance of that particular string?
Bernd, can you explain how a quoted literal of any kind can wreak such havoc in a simple handler? In other words, what is the significance of that particular string?
Craig
I suspect it’s because block commenting starts with /* and ends with */
But yeah, it’s surprising this is happening inside a string literal denoted by quotes…
dunbarx wrote: Mon Jul 18, 2022 2:36 pm
Bernd, can you explain how a quoted literal of any kind can wreak such havoc in a simple handler? In other words, what is the significance of that particular string?
In this particular instance of the problem it was me searching for /* to eliminate comments. My code did not guard against quoted literals. The proposed fix is to eliminate all quoted literals because they are not necessary for formatting.
In a more general sense regarding the Script Editor the problem boils down to a difference between token and word as defined in LC.
try this
put
"/*"
into the field (including the quotes)
in the message box type
put word 1 of field "x" & return & token 1 of field "x"
The script editor uses different techniques to circumvent the problems but each "patch" has its own problems.