All "quotes" are not the same!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
All "quotes" are not the same!
I drafted some code in TextEdit (a Mac editor) and copied to to the script of a button.
The code has several literals in quotes.
There was a compile error -- it didn't recognize the quote chars!
I deleted and added back the quote chars within LC script editor, and it worked.
The chars "quote", "beginning quote", and "end quote" seem to be three different things, and apps seem to encode the keystrokes differently.
You learn something new everyday, I guess!
Regards,
Sri
The code has several literals in quotes.
There was a compile error -- it didn't recognize the quote chars!
I deleted and added back the quote chars within LC script editor, and it worked.
The chars "quote", "beginning quote", and "end quote" seem to be three different things, and apps seem to encode the keystrokes differently.
You learn something new everyday, I guess!
Regards,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: All "quotes" are not the same!
I had a project a couple of years ago where I wanted the "look" of quotes but not ASCII 34 (I ended up using ASCII 210). I did not want ordinary quotes, as they would have botched up my code.
is it possible that the original text used some form of "curly" quotes'?
Craig
is it possible that the original text used some form of "curly" quotes'?
Craig
Re: All "quotes" are not the same!
Craig
I pressed the same quote key on the keyboard, the one next to the enter/return key.
By the way, it was on a sticky note that I had scribbled the code (not in TextEdit).
I tested using nativeCharToNum in the message box:
The quote key pressed in LC returns 34.
The beginning and end quotes in sticky note (may be other Apple apps, too) return 210 and 211.
{Often, I construct bits of code when LC is not open; I use sticky note or TextEdit. I need to be careful!}
Regards,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: All "quotes" are not the same!
Most code editors use the actual key for what you get, 0x34. Some word processors and other tools designed for non-code tasks will have a feature called something like "Smart Quotes" which alters the key to become typographical quotes, as you've found.
If you want to code in non-coding tools, you'll usually find an option in the app's prefs to let you turn off "Smart Quotes".
If you want to code in non-coding tools, you'll usually find an option in the app's prefs to let you turn off "Smart Quotes".
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9358
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: All "quotes" are not the same!
This is because of something called 'smart quotes.'
The basic quote at Decimal 34, Hex 22 in ASCII/Unicode:
- -
is replaced by either:
U+201C (Decimal 8220) leading quote
or
U+201D (Decimal 8221) finishing quote:
- On English operating systems: operating systems running in other languages may vary:
https://en.wikipedia.org/wiki/Quotation_mark
https://practicaltypography.com/straigh ... uotes.html
The basic quote at Decimal 34, Hex 22 in ASCII/Unicode:
- -
is replaced by either:
U+201C (Decimal 8220) leading quote
or
U+201D (Decimal 8221) finishing quote:
- On English operating systems: operating systems running in other languages may vary:
https://en.wikipedia.org/wiki/Quotation_mark
https://practicaltypography.com/straigh ... uotes.html
Last edited by richmond62 on Thu Jan 16, 2020 8:49 pm, edited 1 time in total.
Re: All "quotes" are not the same!
Smart quotes !
And I can turn it off in preferences in TextEdit (not in Stickies, though)!
I must remember to look at the preferences of the apps I use (including LC).
I miss out on a lot of feature power by not doing that.
Thanks, everyone!
Sri
And I can turn it off in preferences in TextEdit (not in Stickies, though)!
I must remember to look at the preferences of the apps I use (including LC).
I miss out on a lot of feature power by not doing that.
Thanks, everyone!
Sri