Book a Demo

Author Topic: Code Generation Template C-style Comments  (Read 3805 times)

lehpat

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Code Generation Template C-style Comments
« on: November 25, 2010, 07:16:19 pm »
Hi,

in my sepcifications I have to generate comments for methods like that:
/*----------------------------------------------------------------------------*/
/* Class::Method(Params)                                                            */
/*----------------------------------------------------------------------------*/
/* Description :                                                                            */
/*                                                                                               */
/* Parameter   :                                                                           */
...
/*----------------------------------------------------------------------------*/

I got nearly everything working, except that the dynamically created content destroys the alignment of the border. How can I manage to align the */ at the line end?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation Template C-style Comments
« Reply #1 on: November 26, 2010, 08:14:26 am »
You may be able to use WRAP_LINES.

Quote
WRAP_LINES(<text>, <wrap_length>, <start_string>[, <end_string])

Wraps <text> as designated to be <wrap_length>, adding <start_string> to the beginning of every line and <end_string> to the end of the line if it is specified.


lehpat

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Code Generation Template C-style Comments
« Reply #2 on: November 26, 2010, 08:08:34 pm »
This does not work, because the line is not filled up with spaces, so the Comment looks like that:

/*----------------------------------------------------------------------------*/

/* Class::Method(Params)  */
/*----------------------------------------------------------------------------*/

/* Description :  foobar  */
/*                                                                                               */
/* Parameter   :  foo  */
...
/*----------------------------------------------------------------------------*/


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Generation Template C-style Comments
« Reply #3 on: November 29, 2010, 09:01:47 am »
Then I don't think you can do it without writing an add-in and getting that to format your notes for you.