Because IntToStr(Value: Integer) is faster (and smaller) than
IntToStr(Value: Int64) - Delphi (apart from Delphi.NET) generates code for
32-bit processors, and thus any 64-bit code will require more CPU cycles.
The linker is also able to optimise out the functions that are not
referenced, thus if IntToStr(Value: Int64) is not referenced, there is no
need for the function to live in the EXE.

Furthermore, by declaring two overloaded functions, code completion shows
both implementations - which more clearly identifies the purpose of
IntToStr.  Showing IntToStr as taking an Int64 parameter only can
potentially be confusing to someone who is new to Delphi.

Dennis.

----- Original Message -----
From: "Trevor Jones" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Monday, August 19, 2002 12:29 PM
Subject: Re: [DUG]: 64 bit ints


> Steve:
>   surely if you have just the one function
>
>   function IntToStr(Value: Int64): string;
>
> and it's not overloaded, then the compiler still won't complain.
>
> That's why I was wondering what I had missed
>
> Trevor
>
> ----- Original Message -----
> From: "Steve Peacocke" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Saturday, August 17, 2002 4:58 PM
> Subject: Re: [DUG]: 64 bit ints
>
>
> > No, you are missing nothing. One converts and Int64, the other an
Integer.
> >
> > Stops the compiler complaining that you are using the wrong variable
type.
> >
> > Steve
> >
> > At 04:26 pm 17/08/02, you wrote:
> > >I use quite a lot of these in my code, and from time to time need to
> convert
> > >them to striings, so I use IntToStr in SysUtils.
> > >
> > >I've noticed that there are two versions (overloaded) in sysUtils:
> > >
> > >{ IntToStr converts the given value to its decimal string
> representation. }
> > >
> > >function IntToStr(Value: Integer): string; overload;
> > >function IntToStr(Value: Int64): string; overload;
> > >
> > >
> > >and their implementation is
> > >
> > >function IntToStr(Value: Integer): string;
> > >begin
> > >   FmtStr(Result, '%d', [Value]);
> > >end;
> > >
> > >function IntToStr(Value: Int64): string;
> > >begin
> > >   FmtStr(Result, '%d', [Value]);
> > >end;
> > >
> > >Am I missing something here?, they seem to be identical.
> > >
> > >Confused Trevor
> > >
> > >
> > >
> >
>
>---------------------------------------------------------------------------
> > >     New Zealand Delphi Users group - Delphi List -
[EMAIL PROTECTED]
> > >                   Website: http://www.delphi.org.nz
> > >To UnSub, send email to: [EMAIL PROTECTED]
> > >with body of "unsubscribe delphi"
> > >Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
>
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
> >
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to