1. Computing & Technology

Discuss in my forum

in Delphi TIPS :: You've probably tried providing a Case statement with string type selector expression, to find out that it only takes ordinal types (which string is not). Looking for a function which enables you to use the Case statement with string type variables?

Read the full article to learn how to create a Delphi CASE statement that Works with String Values!

Related:

Comments
March 23, 2008 at 2:57 pm
(1) M :

There is already a function AnsiIndexText(const AText: String; const AValues: array [] of String):Integer;

August 21, 2010 at 1:11 am
(2) m8i :

how can i implement a code so that it will take the same action for two different cases, iused OR , but it seems that delphi does not recognises it (it compiles but it does not work) :

case myCase of
2 or 3:
//do the action
end;

any one ?

October 11, 2010 at 10:25 pm
(3) chris :

case mynumber of
1,2:

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved.

A part of The New York Times Company.