String issue

19 views
Skip to first unread message

flyway38

unread,
Nov 28, 2022, 11:57:51 AM11/28/22
to jallib
Hello all,

I need to compose a string (for AT commands) which include double quotes (").
How to do it without JAL seeing it as somethig else?
Example:
const byte w1[] = "AT+CSCS="GSM""

Gives this error:
[Error] (ParqTelm_V02.jal) [Line 192]  "gsm" not defined
[Error] (ParqTelm_V02.jal) [Line 192]  unexpected token: gsm

Please help :D
Thank you very much.

Kind regrads,
Filipe Santos

Rob CJ

unread,
Nov 28, 2022, 1:05:09 PM11/28/22
to jallib
Hello Filip,

I had to look this up in the compiler documentation and test.

Apparently this works: 
my_string[] = "AT+CSCS=\x22GSM\x22"

So " should be entered as \x22 (ASCII character for ").

Kind regards,

Rob



Van: jal...@googlegroups.com <jal...@googlegroups.com> namens flyway38 <fsfo...@gmail.com>
Verzonden: maandag 28 november 2022 17:57
Aan: jallib <jal...@googlegroups.com>
Onderwerp: [jallib] String issue
 
--
You received this message because you are subscribed to the Google Groups "jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/f67c9b8f-e1f4-4504-ac72-86a6c48e5220n%40googlegroups.com.

flyway38

unread,
Nov 28, 2022, 1:30:44 PM11/28/22
to jallib
Hi Rob,

I think that \" also works.
Googled and found it...
Thank you.

Cheers,
FS

Pinhead

unread,
Nov 28, 2022, 2:10:45 PM11/28/22
to jallib
I suggest this to be documented in the jal language pdf as an example in the string section....

Just my 2c....

David

Rob CJ

unread,
Nov 29, 2022, 12:40:08 PM11/29/22
to jal...@googlegroups.com
Hi David,

This is already  mentioned in the documentation under the section 'Constants', subsection 'ASCII constant escaping' 🙂.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Pinhead <pinhe...@gmail.com>
Verzonden: maandag 28 november 2022 20:10
Aan: jallib <jal...@googlegroups.com>
Onderwerp: Re: [jallib] String issue
 
Reply all
Reply to author
Forward
0 new messages