Page 1 of 1

[Suggestion] Explicit vs Implicit typecasting

Posted: 16.10.2017, 14:02
by Frédéric Libaud
Hi,

I use the 7.1.x release of Zeoslib and I've saw that there's some difficulties to compile the source with CodeTyphon (Typhon - V6.x) based on FPC 3.x. and Lazarus. Because some instructions contains implicit typecasting.

The best way is to make explicit typecasting with the key word as like :

HashMap.FKeys := (FKeys.Clone as IZCollection);
HashMap.FReadOnlyKeys := (FReadOnlyKeys.Clone as IZCollection);
HashMap.FValues := (FValues.Clone as IZCollection);
HashMap.FReadOnlyValues := (FReadOnlyValues.Clone as IZCollection);

than :

HashMap.FKeys := IZCollection(FKeys.Clone);
HashMap.FReadOnlyKeys := IZCollection(FReadOnlyKeys.Clone);
HashMap.FValues := IZCollection(FValues.Clone);
HashMap.FReadOnlyValues := IZCollection(FReadOnlyValues.Clone);

In ZCollections.pas.

Thank's.

Frédéric Libaud

Re: [Suggestion] Explicit vs Implicit typecasting

Posted: 17.10.2017, 15:54
by miab3
@ Frédéric Libaud

From what I know CodeTyphon(6.20) uses its own adaptation of ZEOS 7.2.x:

- Update pl_ZeosDBO to Ver 6.2.1 Source SVN Rev 3998

Why are you trying to compile an older one?

Michal