Book a Demo

Author Topic: Initial Code (C++) with Code Generation  (Read 2566 times)

xshan

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Initial Code (C++) with Code Generation
« on: November 23, 2005, 03:32:46 pm »
I tried but failed to make the lines added in Initial Code section on a class diagram to appear in the method of the .cpp file after generating the code with either EA 5.0 or EA 6.0 (778).    

Did I miss anything? Please help. Thanks.
« Last Edit: November 23, 2005, 04:19:34 pm by xshan »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Initial Code (C++) with Code Generation
« Reply #1 on: November 23, 2005, 06:08:34 pm »
Are you synchronising to that file or generating?

EA only generates the operation body (including the initial code field) when doing an initial generation.  If the method already exists in the file it will not be updated.

If you do want the method body updated each time you generate, make sure you're overwriting the file.

xshan

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Initial Code (C++) with Code Generation
« Reply #2 on: November 28, 2005, 09:13:58 am »
Thanks Simon for your reply.

I tried to create a class and generate code first time, and also re-generate code with the option of overwriting the file. Neither worked for me.

I do not see anything in .hpp or .cpp file for lines I added in Behavior/Initial Code field.

For lines I added in Behavior/Behavior field, they appear in the method body of the .cpp file with a prefix of "//" for each line. So far I use this as a workaround (I have to remove the ""//" manually after code generation).

Has anyone actually made the initial code generation work?

Thanks.
« Last Edit: November 29, 2005, 12:30:43 pm by xshan »