View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Wed Oct 17, 2012 12:21 pm Post subject: Re: |
|
|
Ingo wrote: |
Edit: Subroutine IntegrateSpeed now seems to work perfectly, I fixed the math errors in IntegrateGamma as well, but I still get the error. The error seems to be related to the dgammaA,dgammaB and dgammaC variables because I do not get an error for the first calculation (I tried that by just making the other calculations 0 and the program ran without problems).
<--CUT--->
I uploaded the reworked IntegrateGamma to Dropbox again (It seems to have messed up my spacing though, as it was all in order):
https://www.dropbox.com/s/i5d8r93tg8dx5pi/ReworkedGamma.txt |
In that latest uploaded file, static analysis shows the following:
line 82: 'dgammaB' is used but never set.
line 99: 'dgammaC' is used but never set. |
|
Back to top |
|
 |
Ingo
Joined: 10 Oct 2012 Posts: 10
|
Posted: Wed Oct 17, 2012 1:49 pm Post subject: |
|
|
So how do you propose to set the variables in this case? I assume what that means is that they do not have an initial value. I tried doing it by setting them to 0 in the definition, like I know from C++. When I do that the program is able to launch, but it just says calculating... and doesn't do anything else. |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Wed Oct 17, 2012 3:12 pm Post subject: Re: |
|
|
Ingo wrote: | So how do you propose to set the variables in this case? I assume what that means is that they do not have an initial value. I tried doing it by setting them to 0 in the definition, like I know from C++. When I do that the program is able to launch, but it just says calculating... and doesn't do anything else. |
These matters are for you to ponder and act upon. You have to know what the calculation is intended to accomplish, and implement the algorithm using the features provided by the language.
Declaration of variables is necessary (unless IMPLICIT typing is in use) but mere declaration does not "define" values for the variables declared.
If it is appropriate that the two variables in question be initialised to zero, add appropriate assignment statements at subroutine entry.
Code: | dgammaB = 0
dgammaC = 0
|
|
|
Back to top |
|
 |
Ingo
Joined: 10 Oct 2012 Posts: 10
|
Posted: Wed Oct 17, 2012 11:34 pm Post subject: |
|
|
I got the program to work. Thank you very much for the great support! |
|
Back to top |
|
 |
|