IBM Support

How do you define a Parameterized Macro within Rhapsody?

Technote (FAQ)


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

Historical Number

40153

Document information

More support for: Rational Rhapsody
General Information

Software version: Version Independent

Operating system(s): Platform Independent

Reference #: 1324301

Modified date: 27 October 2010