>> >> Can anyone say why there is no string case statement in Object Pascal? I've >> always wondered about this as sometimes it hard to avoid 10-20 If..then..else >> if.... statements. >> >> Would the compiled code of a string case statement even be any more >> efficient or >> is the benefit mostly in code readability? > > In the case of strings, it would mostly be code readability. For ordinal > types, a case statement can be optimized using jump tables. > > Michael.
A string case could be optimized with compile-time hashes or something else. -Flávio _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus