weird0 <am********@gmail.comwrote:
// AT+CMGS sends the SMS message
I wish to send the above AT command on the serial port but how should
i write the string for it
which is
"AT+CMGS=+03222345432
Hello World"
temp =@"""AT+CMGS="+03222476927""" + "\n" + " " + msg ;
// Here the compiler gives an error
Whenever you post a question due to an error (whether it's a compiler
error or an exception) it's worth saying what the error is.
In this case it looks like you've got a stray quote after the CMGS=
part. If you change it to
temp =@"""AT+CMGS=+03222476927""" + "\n" + " " + msg ;
it will compile. However, you'll then not quite match your desired
output - you'll still have one quote too many in the output. Try
temp =@"""AT+CMGS=+03222476927" + "\n" + " " + msg;
or the simpler (IMO):
temp = "\"AT+CMGS=+03222476927\n " + msg;
I don't think using a verbatim string literal actually helps in this
case.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too