[Suggestion] Explicit vs Implicit typecasting

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
Frédéric Libaud
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 16.10.2017, 13:51

[Suggestion] Explicit vs Implicit typecasting

Post 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
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: [Suggestion] Explicit vs Implicit typecasting

Post 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
Post Reply