I'm using the BASIC language. Is there any way to include double quotes in a string?
I tried using \"
but it doesn't work.
NOTE: I'm using Nano-10 PLC which supports combination of Ladder and BASIC
I'm using the BASIC language. Is there any way to include double quotes in a string?
I tried using \"
but it doesn't work.
NOTE: I'm using Nano-10 PLC which supports combination of Ladder and BASIC
@vlad awtsu's answer is correct for the normal BASIC language. (+1 for him)
However it didn't work for me on the PLC I've mentioned in the question.
Using CHR$(&H22)
did the job for me. (also works on normal BASIC)
Print "Hello "+ CHR$(&H22) +"World"+CHR$(&H22)
It prints:
Hello "World"
try this one
"She said, ""You deserve a treat!"" "
add "" ""
Dushyant Bangal is correct - although CHR$(34) should work equally well. There is no need to put the value into hex unless you have a preference for it.
(Also, whether doubling up the "" works in "normal BASIC" depends what you mean by "normal". I've seen countless dialects in which CHR$ is the only option.)