Question & Answer
Question
How do you initialize member of a structure in IBM Rational Rhapsody?
Cause
You would like to generate code with initialized values for each member of the structure in Rational Rhapsody.
Answer
You can initialize the members of the structure type in Rational Rhapsody by following the steps below:
- Create a Type under a package
- Add a structure type with some member attributes as shown:
- Create a variable and set the structure type as its Type as shown:
- Enter the initial value within curly brackets <Refer Screen capture in Point 3>
- Override the Property CPP_CG::Attribute::InitializationStyle for the variable to ByAssignment
[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.6.1.3","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21622177