> function MakeMD5Hash(ASource: PChar;
> ADestination: PChar;
> ADestinationMaxSize: Cardinal): Boolean; stdcall;
Also probably a good idea to use fixed types such as longint and longbool, and
bool
rather than integer and cardinal, so the people tapping into the function know
exactly what variable to declare in their language at a certain point of the
year (if
a new compiler comes out things sometimes change). In the documentation for the
function it would be good to specify how big a longint really is, as some C
programmers may have no clue what a longint really is in Pascal.
What performance gains does one get out of using Move()? I've always wondered
why
people use strcopy and strlcopy quite often, when a move could take its place?
Is there any case where Move() might actually hinder performance, or is it
pretty
much wise to estimate the a move will always be faster and/or take less memory?
I could see using a StrCopy if you wanted to use the variable after you were
done
copying it.. because at least you'd still have it available. Is move used too
little,
these days, then, when it really should be used?
> var
> s: string;
> sSize: Cardinal;
> begin
> s := MD5Print(MD5String(ASource));
> sSize := Length(s) + 1;
> if sSize <= ADestinationMaxSize then begin
> Move(PChar(s)^, ADestination^, sSize);
> Result := True;
> end else begin
> Result := False;
> end;
> end;
>
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives