Written by

Sales Account Manager at InterSystems
Question David Reche · Apr 24, 2017

Constant string with quote throw Missing closing quotation mark in Atelier

Hi,

Working with Atelier a valid COS sentence like this:

if $e(chunk,1,1)="""{

}

Throws Missing closing quotation mark error. Any workaround?

Thanks

Comments

David Reche  Apr 24, 2017 to Fabian Haupt

Yes, you are right :-D

0
John Murray  Apr 25, 2017 to David Reche

In that case @David Reche, please accept either Dmitry's answer or mine by clicking the checkmark alongside it. The screenshot below shows you what to look for:

0
Alexey Maslov  Apr 25, 2017 to John Murray

John, it seems that inquiring folks rarely accept answers, maybe because of their rare visits to this site.

With voting feature (like some sites have) it would be possible to "auto-accept" the most voted answer(s) after some reasonable time, e.g. after two weeks.

0
David Reche  Apr 25, 2017 to John Murray

Done!

I didn't saw that option

Thanks for this "double" lesson ;-)

0
John Murray · Apr 24, 2017

If you're trying to check that the first character is " then you need to double the quotes. In other words, test as follows:

if $e(chunk,1,1)=""""

0
Fabian Haupt · Apr 24, 2017

That's because it's not valid COS syntax :) You need """"

0
Raymond Subasic · Apr 25, 2017

I originally posted this to the Google groups cross post and was informed that it would not be seen unless posted here.

Try
if $e(chunk,1,1)=""""{
}

A double quote character is represented by two double quote characters when inside a quoted segment. So:

write """  ; is invalid
write """"  ; produces
"

0
Eduard Lebedyuk · May 4, 2020

As second argument defaults to 1 and third can be skipped you can write just:

if $e(chunk)=""""{
}
0