2

I am creating a program that produces bar graphs. Yesterday, the code compiled normally and ran without a glitch. But when I try to run it now, a read address error occurs. This piece of code is giving the problems:

for K:=0 to Length(arrIncomes) - 1 do
  IncomeBarS.AddXY(arrIncomes[k].dDate,arrIncomes[k].rAmount);

Upon trying to view the source code for the "AddXY" procedure, the IDE gives the error: "Unable to locate file 'TeEngine.pas'". Google couldn't help me. Does anyone know how to fix this? I am using Delphi 2010

Ken White
  • 123,280
  • 14
  • 225
  • 444
Marnu123
  • 77
  • 2
  • 10

3 Answers3

1

The free version of TeeChart that is supplied with Delphi does not include source. Essentially the message you encounter is telling you that. The full commercial version of TeeChart does ship with source.

Looking at your code it seems unlikely that the problem is inside TeeChart. I expect the issue can be found in your code.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I suppose so. But my code ran without a problem. It suddenly started giving problems for no apparent reason – Marnu123 Jul 13 '15 at 08:05
  • There will be a reason. I think your question edit is rather unfair. It seems to me that I answered the question that you asked, and now you are trying to ask another one by way of an edit. – David Heffernan Jul 13 '15 at 08:05
  • I would have accepted your answer if it had fixed the problem, but the code is still not working. The two code segments are identical in almost every way, except that one works and the other does not. – Marnu123 Jul 13 '15 at 08:10
  • 1
    My point though is that the original question was quite focused in scope, and then the edit changed it completely. Here at SO we try to answer the question that was asked rather than solve the problem that led to the question, especially when that wider problem was not originally specified. – David Heffernan Jul 13 '15 at 08:23
  • I don't understand the problem at hand David. I thank you for your help and the extraordinary help that StackOverflow provides. I am still a beginner with little experience. For me, this problem was quite unsolvable as I could not discover an answer. I thus tried to ask the masters (you and your colleagues) for help. If I knew of the wider problem, I wouldn't have asked for your help. What I am trying to say is give me time to learn please. This question could help a kid/beginner in the future. Let us help each other to achieve a greater goal. – Marnu123 Jul 13 '15 at 08:33
  • @Marnu123 I understand. My point though is that SO is very strictly question and answer. Your edit rather drastically changed the question. We are here to answer questions, not to solve your wider problems. You originally asked why the source code could not be found for TeeChart, which is a perfectly good question. I answered that. As you found out, the problem was not related to the code inside TeeChart that you could not find. At that point, in my opinion, you should have asked another question rather than changing this one. I'm trying to help you by explaining how SO works. – David Heffernan Jul 13 '15 at 08:36
  • It appears that my original question could be seen as two different questions. I apologize for the ambiguity and would like to remove the question please. – Marnu123 Jul 13 '15 at 08:43
  • The original question is fine. I've rolled it back to that form. If you want to delete anything, you could delete your answer which refers to code that we have not seen. – David Heffernan Jul 13 '15 at 08:44
1

I am converting from Delphi 2007 (VER185) to Delphi XE6. This is my solution:

{$IFDEF VER185}
  TeEngine,
{$ELSE}
  VCLTee.TeEngine, VclTee.TeeGDIPlus,
{$ENDIF}
Hubert
  • 11
  • 1
0

This message is shown when you don't have the pas file but only compiled DCU. In other words, you don't have the source code of the component.

Anyway, the declarations should be the followings:

Function AddXY(Const AXValue,AYValue:Double; Const ALabel:String='';
                     AColor:TColor=clTeeColor):Integer; virtual;

Function AddY(Const AYValue:Double; Const ALabel:String='';
                     AColor:TColor=clTeeColor):Integer;

It seems that your arrIncomes record has only amount and date records, so in your case you could use AddY instead of AddXY function:

for K:=0 to Length(arrIncomes) - 1 do
  IncomeBarS.AddY(arrIncomes[k].rAmount,DateToStr(arrIncomes[k].dDate));
Gianluca Colombo
  • 717
  • 17
  • 38