Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Double quote in a string


Benjamin.vial Dec 9, 2024 02:49 PM

Hi,

In CrBasic editor I need to enter a line that will be sent to a modem, like this :

SerialOut (COMRS232),"AT+CGDCONT=1,"IP","whatever",0,0".

And as you see the double quote are terminate the string before the line and, so the interpretation is wrong.
And the AT commands want these value into a double quote exclusively (simple quote ' or two quote '' not works, neither the %22 character code).

I didn't find any syntax that could be not interpretate by CrBasic (like the \ in bash).

How I'm doing it ?


Benjamin.vial Dec 10, 2024 02:15 PM

Ok I get it, that's the CHR(34) code :

SerialOut (COMRS232),"AT+CGDCONT=1,"IP","whatever",0,0".

Become :

SerialOut (COMRS232),"AT+CGDCONT=1,"+CHR(34)+"IP"+CHR(34)+","+CHR(34)+"whatever"+CHR(34)+",0,0"

No need to review this post anymore.

Log in or register to post/reply in the forum.