> guess from a strict computer science POV, that it is not a good idea to do a
> case select on a string - its not efficient & matching strings gets dodgy if
> you need to consider case & spaces etc.
>  
> My approach is to drop the strings & use a enum type...ie:
>  
> type
>  TResponseTypes =  ( rtHello, rtGoodBye );

I would hope that everyone would always avoid string comparison unless strictly
necessary as it certainly isn't very processor friendly - although in this case a
comparison using comparemem might be faster than using normal string
comparisons since an exact equality or inequality is all that's needed rather than
Less than or greater than... Of course the gain in this will be drastically offset by
how similar the strings are since a true string comparison short circuits at first
difference...

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


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

Reply via email to