Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CML Macros - Replacing Quotes
Trying to find out why I cannot replace a quote using ReplaceChar in a CML Driver using ReplaceChar.

I have a String

+CMGL: 1,"REC UNREAD","+11231231234","","21/02/11,15:18:09-20"

And I am trying to replace the quotes with blanks

tempString.ReplaceChar('"', '');

I receive an error

A badly formed character literal value was seen

This same driver (SMS) does the same thing with no error:

I took a different route using ParseQuotedCommaList that worked just fine.
The empty character isn't a valid character. If you want to replace with nothing, it has to be with a string, so you'd need to do a substring type replacement of "\"" with "". Not the escapement character to create a quoted string with a quote in it.
Dean Roddey
Explorans limites defectum

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling global actions from macros dlmorgan999 1 1,445 07-12-2015, 08:07 AM
Last Post: Dean Roddey
  Macros won't load in editor - service restart required bbrendon 6 3,235 05-03-2014, 12:47 PM
Last Post: Dean Roddey
  LogMsg in macros? beelzerob 6 2,702 04-27-2009, 06:15 AM
Last Post: beelzerob
  Stock Quotes anogee 7 3,410 01-08-2009, 08:06 PM
Last Post: Sendero
  Fun with single and double quotes within strings jrlewis 10 3,144 09-08-2008, 12:46 PM
Last Post: Dean Roddey
  CML/Driver - Async Macros bph 5 2,059 08-02-2008, 11:30 PM
Last Post: Dean Roddey
  2.4 Exception in Driver Harness When Loading Macros wuench 2 1,480 07-02-2008, 11:11 AM
Last Post: Dean Roddey
  Actions, Macros, and Parameters noworries 6 2,042 01-20-2007, 05:24 PM
Last Post: Dean Roddey
  CML-Embedded Quotes in a String Mikla 2 960 12-17-2006, 07:56 AM
Last Post: Mikla

Forum Jump:

Users browsing this thread: 1 Guest(s)