replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Undefined Variable Error
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Undefined Variable Error
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Oct 17, 2012 12:21 pm    Post subject: Re: Reply with quote

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
View user's profile Send private message
Ingo



Joined: 10 Oct 2012
Posts: 10

PostPosted: Wed Oct 17, 2012 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Oct 17, 2012 3:12 pm    Post subject: Re: Reply with quote

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
View user's profile Send private message
Ingo



Joined: 10 Oct 2012
Posts: 10

PostPosted: Wed Oct 17, 2012 11:34 pm    Post subject: Reply with quote

I got the program to work. Thank you very much for the great support!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group