I've managed to get an ASP page working, thanks to Stephen.  Though I had to
change the C:\ to Server.MapPath().  And CreateTextFile seems to only have 2
parameters.  What does the 3rd one do?

I would like to convert a small delphi hash function to VBScript but I've
never used VB or VBScript before.  Can anyone help with this, or is it even
possible?

function Hash(const Buf: String): LongInt;
var
  I, X: LongInt;
begin
  Result := 0;
  for I := 1 to Length(Buf) do
  begin
    Hash := (Result shl 4) + Byte(Buf[I]);
    X := Result and $F0000000;
    if (X <> 0) then Result := Result xor (X shr 24);
    Result := Result and (not X);
  end;
end;

Feeding in "ABC" results in the number 17763.

Many thanks,
Ross Levis.

---------------------------------------------------------------------------
    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