IBM Support

How do you define a Parameterized Macro within Rhapsody?

Question & Answer


Question

How do you define a Parameterized Macro within Rhapsody?

Answer

Here are the steps to define a Parameterized Macro within Rhapsody

1: Create a Project with a Class calling its constructor.

2: Create a Type called 'Max'

3: Double click on 'Max" and under General Tab select Kind = Language.

4: Under the declaration Tab use the following implementation:
#define %s(a,b) if(a<b)\
printf("%d",a);\
else\
printf("%d",b)

5: Under the Implementation of Constructor of the class use:
printf("\n Value of Max = ");
Max(15,86);

6: Save the Project. Generate/Make/Run

AnswerProduct versionPartner ContentInternal ContentCategoryReference IDAuthor

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

40153

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21324301