Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Initialise attributes that are structure types
Topic Summary:
Created On: 17-May-2007 07:51
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 17-May-2007 07:51
User is offline View Users Profile Print this message


Charlie Lane

Posts: 86
Joined: 16-Sep-2005

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?
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.