![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() Answer: Hi Peter, I tried your "workaround" and it worked just fine. Thank you very much!!! Regards, Pranav | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Thank you very much Louie!!! I appreciate the additional snippet of code for the "*" function.
|
|
![]() |
|
![]() |
|
Hi Peter,
I tried your "workaround" and it worked just fine. Thank you very much!!! Regards, Pranav |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.