Or...

You could write a function to do return the matching index, then "case"
that...

something roughly like...

MyFunction(AString: String; AStringList: TStringlist): Integer
var
        I: Integer;
begin
        For I := 0 to AStringList.Count -1 do
                If AString = AStringList.Strings(I) Then
                begin
                        Result := I;
                        Exit;
                end;
end;

Regards
Paul McKenzie

Unisys

Phone:  64-04-462 2287
E-mail: [EMAIL PROTECTED]

(Wellington - New Zealand)


-----Original Message-----
From: Matt Powell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 15 February 2000 02:59 PM
To: Multiple recipients of list delphi
Subject: Re: [DUG]: VB Like Case statement


> This  has its good and bad points, BUT ofcourse in Delphi it pretty
> much has to me an integer etc.
> Does anyone have any ideas how this could be implemented in Delphi, OR
> if Delphi has a simlilar type of thing....

You could convert each string to its (7-bit ASCII-encoded) numerical
equivalent... eg
'Hello' = 72 101 108 108 111 
        = 1001000 1100101 1101100 1101100 1101111
        = 1001 0001 1001 0111 0110 0110 1100 1101 1110
        = $919766CDE

...but that would be cumbersome ;)

- Matt
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to