Book a Demo

Author Topic: Code template editor : escape double quote  (Read 5295 times)

vinzz38

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Code template editor : escape double quote
« on: July 31, 2013, 07:42:26 pm »
Hello.

How can i escape a double quote in a string value in the code template editor?
I try raech my goal like this (escape the double quote with an antislash):
$imports = %REPLACE(fileImports, ".h\"", ".hpp\"")%
But it does not work. Any idea?

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Code template editor : escape double quote
« Reply #1 on: July 31, 2013, 08:50:31 pm »
It has been asked recently here. Try the search button top left.

q.

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Code template editor : escape double quote
« Reply #2 on: July 31, 2013, 09:22:59 pm »
There's a macro for double qoute: %qt%
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code template editor : escape double quote
« Reply #3 on: August 01, 2013, 08:38:03 am »
Just ignoring the question you asked to focus on the example you gave...

If what you're trying to do is make the #include statements generated by EA reference .hpp files, then changing the 'Header Extension' option in Tools | Options | Source Code Engineering | C++ will do that without changing the templates.

vinzz38

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Code template editor : escape double quote
« Reply #4 on: August 01, 2013, 07:57:32 pm »
Thank you both.

The macro %qt% works.

Simon, is it possible to change this option programmaticly or with a macro instruction. I saw the macro genOptCPPHeaderExtension in the doc, but how to modify it ?

Thanks.  :)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code template editor : escape double quote
« Reply #5 on: August 02, 2013, 09:01:18 am »
I'm sure you could do it via sql if you really wanted to. But in the time it would take you to read this post you could do it via the UI, and if you were concerned about doing it in every new project you could change it in your base model.