Variant conversion Fail for Int64/LargeInt

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
aagusti
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 03.04.2012, 16:24
Contact:

Variant conversion Fail for Int64/LargeInt

Post by aagusti »

We know VInteger defined as Int64 but after I search at Unit ZVariant.pas Starting at Line 1081 convertion for Vint From String and attach using Integer conversion

Code: Select all

  vtInteger:
      case Value.VType of
        vtNull:
          Result.VInteger := 0;
        vtBoolean:
          if Value.VBoolean then
            Result.VInteger := 1
          else Result.VInteger := 0;
        vtInteger:
          Result.VInteger := Value.VInteger;
        vtFloat:
          Result.VInteger := Trunc(Value.VFloat);
        vtString:
          Result.VInteger :=  StrToInt64Def(Value.VString, 0); //StrToIntDef(Value.VString, 0);
        vtUnicodeString:
          Result.VInteger :=  StrToInt64Def(Value.VUnicodeString, 0);//StrToIntDef(Value.VUnicodeString, 0);
        vtDateTime:
          Result.VInteger := Trunc(Value.VDateTime);
        vtPointer:
          Result.VInteger := Int64(Value.VPointer);//Integer(Value.VPointer);
        vtInterface:
          RaiseTypeMismatchError;
      end;
CMIIW
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

We know VInteger defined as Int64 but after I search at Unit ZVariant.pas Starting at Line 1081 convertion for Vint From String and attach using Integer conversion
Is this also true on 32 bit compilers? And isn't the conversion Integer() working correctly in 64 compilers?

Mark
Image
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Still done, Mark.

Don't know the Rev. anymore. In meanwhile this patch should be in the trunk too.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Yes, but we're talking about the 6.6-patches branch here... Is it applicable there too?

Mark
Image
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Nope, you're right..

We need this in 6.6.6 too
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply