I do use that object…
procedure TClassInstanceDictionary.SendNotifyTelegram(const id: Integer; const tlg: TPSDTelegramBase);
var
Obj : TBaseClass;
begin
Obj := Items[Id] as TBaseClass; // <– Hint
Obj.SendNotifyTelegram(tlg);
end;
[dcc32 Hint] SomeUnit.pas(xxx): H2077 Value assigned to ‘Obj’ never used
Nobody uses telegrams anymore, that so 1800’s 😉
When you have multiple concurrent client apps that massage the same data sets. and a server that mess with the massaged data – telegrams are a necessary evil – unless you want to go MQ or something – and – you don’t.
Telegrams are the printed version of messages sent through http://en.wikipedia.org/wiki/Telegraphy, I’m sure you have better options than printing on dead tree and using OCR to communicate between them, even punch cards are outdated 😉
I suppose you’re referring to http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.71.7128 (it’s the only one I could find that uses this terminology)
As for your issue, is that a generic dictionary? If so you might be able to go around the hint by declaring an intermediate function.
function xxx.GetItem(key) : valuetype
begin
result:= Items[key];
end;
Or just get rid of the dead variable:
(Items[id] as TBaseClass).SendNotifyTelegram (tlg);
Willo van der Merwe – That’s a bit trickey in XE4.
procedure TClassInstanceDictionary.SendNotifyTelegram(const id: Integer; const tlg: TPSDTelegramBase);
begin
(Items[Id] as TBaseClass).SendNotifyTelegram(tlg);
en|d;
^[dcc32 Fatal Error] SomeUnit.pas(xxx): F2084 Internal Error: C1769
Same for
TBaseClass(Items[Id]).SendNotifyTelegram(tlg);
Oh dear. I thought the compiler might choke, but not like that!
Hard cast it?
Lars Fosdal sounds to me like you uncovered a compiler bug.
Can you recreate it in a new project, with a similar sample class?
I’ll try – but there are several other massive generics classes in the unit, so it might not be possible to make a “mini version” of it.
not impressed with xe4, not impressed at all… hoping that xe5 will worth it…
There are a few nice small changes for the better – but yeah – it is still plagued with a lot of the old troubles with regards to the IDE, and not to forget – useless internal errors in the Generics compiler.
„There are a few nice small changes for the better¯
you should get at least “something” for the upgrade… but based on your posts(thank you a lot for them), it seems that there’s quite a bit of hassle to upgrade, many things need to be tested and fiddle with in order to keep my projects working…
No more hassles than expected, I’d say. It’s on par with the previous updates.
… not that it in any way should be seen as a measure of success. They really need to improve the IDE.
oh yea, the friggin’ IDE!!
Dorin Duminica The compiler went straight downhill regarding generics from XE3 on … I just completly ticked out yesterday when I read the resolution comment on QC#116151…
Stefan Glienke Ouch…