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: Init variable with different values (Rhapsody 6.1 C)
Topic Summary:
Created On: 20-Apr-2007 09:39
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.
 20-Apr-2007 09:39
User is offline View Users Profile Print this message


Jens Konnertz

Posts: 10
Joined: 21-Feb-2007

Hello,

I like to init a variable with different values depending on a #ifdef statement.

E.g.
#ifdef TEST
static const a = 0;
#else
static const a = 1;
#endif

Do anybody have an idea on how to model this in Rhapsody.

Thank you and best regards
Jens
Report this to a Moderator Report this to a Moderator
 28-Apr-2007 09:15
User is offline View Users Profile Print this message


Ian Turner

Posts: 25
Joined: 3-Feb-2006

Hi Jens,

try the following:

Define a type called CONST_VALUE of type language:

#ifdef TEST
#define %s 0
#else
#define %s 1
#endif

Define a variable called "a" with an initial value of CONST_VALUE and make it constant.



regards,

Ian
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.