Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: A rather strange syntax error involving multiplication of variables
Topic Summary:
Created On: 1-Dec-2008 10:58
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
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.
Answer This question was answered by Pranav Chandrasekhar, on Monday, December 1, 2008 4:02 PM

Answer:
Hi Peter,
I tried your "workaround" and it worked just fine. Thank you very much!!!

Regards,

Pranav
 1-Dec-2008 10:58
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

This is a rather strange syntax error I am getting. I have been trying to work on it for a while but am hitting a dead end. The lines of code with the issue are below:

1 real AnalysisWt = 0.35
2 real ReviewWt = 0.35
3 real ReleaseWt = 0.3
4
5 real BacPerRqt = (BAC/totreq)
6 //real bcwpAnalysis, bcwpReview, bcwpRelease
7 real bcwpAnalysis = analysisreq * AnalysisWt * BacPerRqt
8 real bcwpReview = reviewreq * ReviewWt * BacPerRqt
9 real bcwpRelease = releasereq * ReleaseWt * BacPerRqt

I get the following error for lines 7, 8 and 9.

E- DXL: <Line:7> incorrect arguments for (*)
-E- DXL: <Line:7> incorrect arguments for (*)
-E- DXL: <Line:8> incorrect arguments for (*)
-E- DXL: <Line:8> incorrect arguments for (*)
-E- DXL: <Line:9> incorrect arguments for (*)
-E- DXL: <Line:9> incorrect arguments for (*)

Incidentally, the variables analysisreq,reviewreq, and releasereq have been declared and assigned earlier as integers.

This seems like a rather trivial problem but I have no luck trying to sort it out. Any input would be highly appreciated. Thank you in advance.

Regards,

Pranav
Report this to a Moderator Report this to a Moderator
 1-Dec-2008 11:54
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

DXL can not handle multiplications between integer and real variables. You must replace all integer variables "i" by "realOf(i)". Try

realOF(analysisreq) * AnalysisWt * BacPerRqt

Peter
Report this to a Moderator Report this to a Moderator
 1-Dec-2008 11:56
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

Hi Peter,
Thank you for your prompt and helpful response to my post. I will try this right away. Thank you once again.

Regards,

Pranav
Report this to a Moderator Report this to a Moderator
 1-Dec-2008 15:52
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes.

Regrettably, this is by no means obvious in the manual. Looking at section 'Operations of type int' it does show that "int x * int y" is valid. Looking at section 'Operations of type real' it does show that "real x * real y" is valid. Its hard to tell, but since its silent about "int x * real y" then you cannot do it.

Notice that it DOES say you can do this: "real r = int i", so you can do the translation directly in an assignment statement.

If you use a library, you CAN write your own overloaded function for "*" as attached.

- Louie
Report this to a Moderator Report this to a Moderator
 1-Dec-2008 16:00
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

Thank you very much Louie!!! I appreciate the additional snippet of code for the "*" function.
Report this to a Moderator Report this to a Moderator
 1-Dec-2008 16:02
User is offline View Users Profile Print this message


Pranav Chandrasekhar

Posts: 101
Joined: 16-May-2006

Answer Answer
Hi Peter,
I tried your "workaround" and it worked just fine. Thank you very much!!!

Regards,

Pranav
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

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