Jump to content
direktor05

Int64 and other ints conflict

Recommended Posts

Hello, can someone explain what is wrong here and why this doesn't fit together and why I can't typecast Int64(Integer):

 

Operator not applicable to this operand type error below: How to fix this? 

 

function TDIUnicodeWriter.WriteDecimalNumber(ValueNumber: Int64): Boolean;
label
  1;
var
  StartDiv: Int64;
  i: Cardinal;
begin
  if ValueNumber < 0 then  -> HERE
    begin
      Result := WriteCharW(WC_HYPHEN_MINUS);
      if not Result then Exit;
      ValueNumber := -ValueNumber;  -> HERE
    end;

  StartDiv := 1000000000000000000;  -> HERE (Incompatible types)

  repeat
  i := ValueNumber div StartDiv; -> HERE
  if i > 0 then Break;
  StartDiv := StartDiv div 10;  -> HERE
  if StartDiv < 10 then goto 1;  -> HERE
until False;

repeat
  Result := WriteCharW(WA_NUM_TO_HEX[Cardinal(i)]);

  if not Result then Exit;

  Dec(ValueNumber, i * StartDiv);
  StartDiv := StartDiv div 10; -> HERE
  if StartDiv < 10 then Break; -> HERE
  i := ValueNumber div StartDiv; -> HERE
until False;

1:
Result := WriteCharW(WA_NUM_TO_HEX[ValueNumber]); ->  (Incompatible types)

end;

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×