Book a Demo

Author Topic: Help with Arrays  (Read 5715 times)

Hirsel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Help with Arrays
« on: March 28, 2006, 02:00:24 am »
Hi there,

first of all I have to admit that I'm complete new to the UML language and software modelling   :-/

I just started 2 days ago to model a new software project with EA. At the moment I've got a slight problem with modelling an Array.

Is it possible to give a class an attribut e.g. int test[20] ?? And maybe in a may so that Code generation (C++) works??
I've read a lot about Collections, Containers and so on and from my point of view some discussions here beat a philosophie board (that's a compliment :D)

So if it's not possible to do it an an easy way I would VERY grateful if anybody could give me a bit of a step by step instruction...

thx a lot

bye

Hirsel

ps: I tried to add [50] at the end of the attributs name e.g feld[50]. In this case the code generations works probably.... Is this the only/correct way??
« Last Edit: March 28, 2006, 02:14:48 am by Hirsel »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Help with Arrays
« Reply #1 on: March 28, 2006, 04:33:22 am »
Create your attribute as usual. Once you have done so, and save the attribute, the "Details" tab of the attribute dialog will be enabled.

On the Details page set the lower and upper bounds of the multiplicity to 50. I'm assuming you want just a plain old array, so don't check other options etc. Save everything and exit the Attributes, and if necessary the Class, dialog.

When you go back to your diagram you will find that you have an attribute something along the lines of:
+bar: int[50]
No, you can't have it!

Hirsel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Help with Arrays
« Reply #2 on: March 28, 2006, 07:49:28 am »
Oh thx mate :D

It tried this serveral times (but without setting the LOWER bound to 50 :D) so thx to your help it works fine now!

*behappy*

bye

Hirsel