All "quotes" are not the same!

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
sritcp
Posts: 424
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

All "quotes" are not the same!

Post by sritcp » Wed Jan 15, 2020 6:00 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6468
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: All "quotes" are not the same!

Post by dunbarx » Wed Jan 15, 2020 6:17 pm

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

sritcp
Posts: 424
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: All "quotes" are not the same!

Post by sritcp » Wed Jan 15, 2020 6:36 pm

dunbarx wrote:
Wed Jan 15, 2020 6:17 pm
is it possible that the original text used some form of "curly" quotes'?
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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7306
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: All "quotes" are not the same!

Post by FourthWorld » Wed Jan 15, 2020 7:26 pm

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".
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 4024
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: All "quotes" are not the same!

Post by richmond62 » Wed Jan 15, 2020 7:39 pm

This is because of something called 'smart quotes.'

The basic quote at Decimal 34, Hex 22 in ASCII/Unicode:
-
quotes.png
-
is replaced by either:

U+201C (Decimal 8220) leading quote

or

U+201D (Decimal 8221) finishing quote:
-
quotesTWO.png
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.

sritcp
Posts: 424
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: All "quotes" are not the same!

Post by sritcp » Wed Jan 15, 2020 8:38 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”