![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Initialise attributes that are structure types Topic Summary: Created On: 17-May-2007 07:51 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
We have a type T defined that, in the type definition, is of Kind=Structure and has 6 integer attributes.
There is an attribute Y of actor A defined to be of type T. To initialise a variable X of type T I could write C++ code: X = { 0, 0, 0, 0, 0, 0}; I want the attribute Y of actor A to be initialised, but a) I get compile errors if I put 0,0,0,0,0,0 as the initial value of Y (in the General tab for Y) b) I cannot add a constructor to actor A (menu option doesn't appear) My work-around is to define a function toT, in the same package that contains T, that has 6 arguments and returns a T, then the initial value of Y can be set as toT(0,0,0,0,0,0) and this works OK. Is there a more elegant way of initialising attributes that are structure types? |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.