Book a Demo

Author Topic: how to create/generate arrays?  (Read 4661 times)

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
how to create/generate arrays?
« on: November 28, 2012, 08:34:23 pm »
Hi

I need to create an pointer to an array of funktions.

but actually I do not get how to create an array. Is that possible?
Support- Languages: German, English, French

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: how to create/generate arrays?
« Reply #1 on: November 29, 2012, 08:15:06 am »
Hi,

You can specify C arrays using the 'Container Type' field from the attributes' properties 'Details' tab:



HTH
Günther

PS.: I found these things by reverse engineering the valid C code. I think this is generally a good approach to find out what will work from forward code generation and how.
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

MREA

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: how to create/generate arrays?
« Reply #2 on: November 29, 2012, 05:26:35 pm »
ahh ok,
thank you again!

and how to do this for parameters?
because this is what EA ignores,and i'm looking for at the moment
« Last Edit: November 29, 2012, 05:30:05 pm by EAIFM »
Support- Languages: German, English, French

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: how to create/generate arrays?
« Reply #3 on: November 30, 2012, 03:34:00 am »
I came over the problem with parameters defined as fixed array types earlier, and know that EA can't handle these correctly when reverse engineering the code.

I would recommend that you place the fixed array into a struct as shown in the sample, and pass this struct as parameter.

Best regards,
Günther

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: how to create/generate arrays?
« Reply #4 on: November 30, 2012, 07:00:10 am »
[can't edit from this account]

Sorry I was wrong with my former reply. I remember problems with array parameters, but that might have been with C++ specific code or an earlier version of EA.

You can simply postfix your parameter name with the array specifier in the 'Parameters' field of the 'Operation properties' dialog:


This works with reverse and forward engineering.

[edit]
There seem to appear issues with function pointer types, I'm researching on this (see also: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1354223085).
[/edit]

Best regards,
Günther
« Last Edit: November 30, 2012, 08:20:51 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/