Strange access violation error.
I'm receiving an access violation when a report is run for the second time
(using the search feature). I've isolated the offending code, but it looks
fine. It's just some floating point calculations - add, multiply, divide,
etc. There are also a couple of calls to Sqrt, Exp, and Ln, but removing
these alone still does not resolve the problem. What's really strange is
that everthing works the first time through.
I'm running Delphi 5 and Report Builder Enterprise 7.03. Here are the
offending lines of code (I've shortened the variable names for convenience.
They are all the same type - "Extended").
SD:=SD+V*V;
T:=T+V;
YTD:=100*((1+(V1/100))*(1+(V2/100))-1);
Q:=Q+Ln(1+V/100);
AA:=100*Exp(12*(AA/(P+N)))-100;
SD:=100*SQRT(12)*SQRT((SD-((AA*AA)/(N+P)))/(N+P-1));
Anyone have any ideas?
(using the search feature). I've isolated the offending code, but it looks
fine. It's just some floating point calculations - add, multiply, divide,
etc. There are also a couple of calls to Sqrt, Exp, and Ln, but removing
these alone still does not resolve the problem. What's really strange is
that everthing works the first time through.
I'm running Delphi 5 and Report Builder Enterprise 7.03. Here are the
offending lines of code (I've shortened the variable names for convenience.
They are all the same type - "Extended").
SD:=SD+V*V;
T:=T+V;
YTD:=100*((1+(V1/100))*(1+(V2/100))-1);
Q:=Q+Ln(1+V/100);
AA:=100*Exp(12*(AA/(P+N)))-100;
SD:=100*SQRT(12)*SQRT((SD-((AA*AA)/(N+P)))/(N+P-1));
Anyone have any ideas?
This discussion has been closed.
Comments
I would recommend trying to break up your calculations below into a few more
intermediate steps. In past experience, this seemed to solve many problems.
If you are still having an issue, please send an example that shows this AV
and I'll try to find the cause for you.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com