Hi there,

I am currently struggling through trying to figure out why a statement in my source code isn't being executed when running the program.

The code is as follows:

taxableValueDifference := previousTaxableValue - newTaxableValue;
grandTotalTVDifference := grandTotalTVDifference - taxableValueDifference;
XLWorksheet.Cells[row, 7].Value := XLWorksheet.Cells[row, 7].Value + taxableValueDifference;

The first and last statement execute, but the middle statement is just skipped. Any ideas as to why this is so?

Thanks in advance!!

If optimization is turned on in your compiler settings, this line will be skipped, because it is not used. Turn optimization off while debugging to avoid this.

Still no luck. I'm not very experienced with Delphi. I'm using Delphi 2010. It seems that whenever I try to reference the variable grandTotalTVDifference the line won't be executed. If anyone has any suggestions it would really help.

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.