...einen String in einem eindeutigen (Indexierung) Integer konvertieren?
Autor: Alfredo Fernandes
///////////////////////////////////////////////
//This function Convert a string to a number,
//is useful when you need to index strings.
//Every string will become a different number.
///////////////////////////////////////////////
type
UInt64 = 0..9223372036854775807;
function Unc(s: string): UInt64;
var
x: Integer;
begin
Result := 0;
for x := 1 to Length(s) do Result := Result + ((Ord(s[x])) shl ((x - 1) * 8));
end;
printed from
www.swissdelphicenter.ch
developers knowledge base