[solved] Invalid Typecast exception in charteditor demo lazarus / 55-TAChart ---------------------------------------------------------------------- Muso · 2021-04-17 21:32 There is a bug in the TAChart demo "charteditor": - run the program using Laz 2.1dev - click onto the title of an axis - in the appearing dialog do nothing but pressing OK - now click on the chart title result: Invalid Typecast exception, see the attached screenshot. ------------- When this is fixed, could line 89 of ceLegendDlg.pas please be changed to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i LegendEditor: TLegendEditor; because the current Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i AxisTitleEditor: TLegendEditor;is misleading. The same for line 52 of ceTitleFootDlg.pas where it should be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i TitleFootEditor: TTitleFootEditor;instead of Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i AxisTitleEditor: TTitleFootEditor; ---------------------------------------------------------------------- wp · 2021-04-18 08:50 Done. Thanks for reporting. ---------------------------------------------------------------------- Muso · 2021-04-18 13:33 Many thanks for the fix! There are now only two minor things: When compiling the demo I get these compiler messages: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Compile Project, Target: charteditordemo.exe: Success, Hints: 6ceaxisdlg.pas(181,14) Note: Call to subroutine "function TChartAxis.GetMarks:TChartAxisMarks;" marked as inline is not inlinedceaxisdlg.pas(212,16) Note: Call to subroutine "function TChartAxis.GetMarks:TChartAxisMarks;" marked as inline is not inlinedceaxisdlg.pas(291,14) Note: Call to subroutine "function TChartAxis.GetMarks:TChartAxisMarks;" marked as inline is not inlinedceaxisdlg.pas(338,12) Note: Call to subroutine "function TChartAxis.GetMarks:TChartAxisMarks;" marked as inline is not inlinedceaxisdlg.pas(382,14) Note: Call to subroutine "function TChartAxis.GetMarks:TChartAxisMarks;" marked as inline is not inlinedcetitlefootdlg.pas(63,23) Hint: Local type "TChartTitleAccess" is not used  What does "marked as inline is not inlined" mean and how can this be fixed? (I could filter these messages but then I also loose the hints I want to see for my project.) ---------------------------------------------------------------------- Thaddy · 2021-04-18 13:40 Inline is a request to the compiler to try to inline a certain routine. The compiler can decide that a routine is too complex - or slower - to inline. Hence the compiler informs you that it can not inline. It is a hint. Not a warning or error. Your code is not affected. ---------------------------------------------------------------------- Muso · 2021-04-18 13:44 Quote from: Thaddy on April 18, 2021, 03:40:41 pmInline is a request to the compiler to try to inline a certain routine. The compiler can decide that a routine is too complex to inline. Hence the compiler informs you that it can not inline. It is a hint. Not a warning or error. Thanks. The point is I know that it is only a hint but I use now the new TAChart tools in my project and get these hints. Filtering out all hints, however will filter out the hints I want to see. Therefore it would help me to know what I have to do to silence the compiler, making the routine less complex. ---------------------------------------------------------------------- wp · 2021-04-18 15:21 You could open the TAChart package file (TAChartLazarusPkg.lpk in components/tachart) > "Options" > "Compiler Options" > "Messages" and type "inline" in to filter box at the top. One of the remaining messages is "Note: Call to subroutine "$1" marked as inline is not inlined". When you remove the checkmark and rebuild the IDE, all these warnings will be gone. You will have to repeat the same with the project. The reason why this is not done in the official sources is that trunk must compile also with FPC 3.0.4, but this version chokes on the corresponding change in the lpk file and then refuses to build the IDE... ---------------------------------------------------------------------- Muso · 2021-04-18 15:39 Quote from: wp on April 18, 2021, 05:21:23 pmYou could open the TAChart package file (TAChartLazarusPkg.lpk in components/tachart) > "Options" > "Compiler Options" > "Messages" and type "inline" in to filter box at the top... Many thanks! However, could you please do the little change to silence this compiler warning: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cetitlefootdlg.pas(63,23) Hint: Local type "TChartTitleAccess" is not used ---------------------------------------------------------------------- wp · 2021-04-18 15:43 Yes, already done. And I also removed each "inline" hint from the charteditor demo individually by using the {%H} directive ---------------------------------------------------------------------- Muso · 2021-04-18 17:09 Quote from: wp on April 18, 2021, 05:43:10 pmYes, already done. And I also removed each "inline" hint from the charteditor demo individually by using the {%H} directive Many thanks! I got these inline messages also on other occasions and know now how to silence them.