Recent

Author Topic: quotation marks and apostrophes on MacOS Catalina  (Read 846 times)

namio.sousa

  • Newbie
  • Posts: 4
quotation marks and apostrophes on MacOS Catalina
« on: December 27, 2022, 04:59:07 am »
I'm new using Lazarus. I installed it under MacOS Catalina. How can I make it recognize quotation marks and apostrophes?

For example: when I try to type

Code: Pascal  [Select][+][-]
  1. res.ContentType := 'application/json';

I am unable to make it recognize the single quotes. I type them, but they don't appear in the editor. I've already tried the option + ] key combination and the single quote was written, but when I compile the code, I get the invalid character message.

Does anybody know how to solve this?

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: quotation marks and apostrophes on MacOS Catalina
« Reply #1 on: December 27, 2022, 08:20:48 am »
If you want to insert a apostrophy within quoted string, put it twice.

Code: Pascal  [Select][+][-]
  1. stringvariable := 'this is my mother''s flower.';

Lansdowne

  • New Member
  • *
  • Posts: 30
Re: quotation marks and apostrophes on MacOS Catalina
« Reply #2 on: December 27, 2022, 09:08:03 am »
I don't know about MacOS, but in general there is a thing called "smart quotes". 

That is usually in word processing software, where you type 'pascal' and it auto-changes the first apostrophe into a "left single quote" and the one after the word into a "right single quote".

Of course, that is not what you want.  The compiler needs to see a straight ' character which is ASCII 39, nothing else will do.  Hopefully this is what the ' key on your keyboard will produce when typing in the IDE.

namio.sousa

  • Newbie
  • Posts: 4
Re: quotation marks and apostrophes on MacOS Catalina
« Reply #3 on: December 28, 2022, 12:10:17 am »
If you want to insert a apostrophy within quoted string, put it twice.

Code: Pascal  [Select][+][-]
  1. stringvariable := 'this is my mother''s flower.';

In fact, egsuh, I'm having problem to write the single quotation mark at code editor. Lazarus simply does not recognize when I hit the single quotation mark key at code editor window.

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: quotation marks and apostrophes on MacOS Catalina
« Reply #4 on: December 28, 2022, 12:29:25 am »
Take a very good look at your single quote. Is is leaning ? Then you have a German style editor problem. OSX itself does not have that problem, nor does Lazarus. (Geany had that too but I fixed - well an applied patch - that)
« Last Edit: December 28, 2022, 12:31:23 am by Thaddy »
Specialize a type, not a var.

namio.sousa

  • Newbie
  • Posts: 4
Re: quotation marks and apostrophes on MacOS Catalina
« Reply #5 on: January 02, 2023, 12:54:22 am »
No, Thaddy. It's not leaning. In fact the code editor window cannot recognize when I press the quotation keys at mac book keyboard. But Lazarus recognize them at other windows.

 

TinyPortal © 2005-2018