

the case labels will notĬhange just because you sort the list, or add a string in the middle of the Pro: This method is 'sort and insertion-safe', i.e. SuitList.AddObject('Spades', TObject(Spades)) Ĭase TSuit(SuitList.Objects) of SuitList.AddObject('Hearts', TObject(Hearts))

That aside, you could use a combination of both methods, with a little more If you ever want to translate your program to a different (user) language.
#Xmen vs street fighter ps4 code#
> Wayne Niddery - TeamB (> Tips to Get Published: įirst of all, you should probably *not* test hard-coded strings in your code > SuitList.CommaText := 'Hearts, Spades, Diamonds, Clubs' > to add the strings to and then use the lookup index in the case: > If this is no good for some reason then another way is to use a stringlist > TSuitNames = array of string = ('Hearts', 'Spades', 'Diamonds',Īnything wrong with casting the first character of a string literal to a charĪnd using that (assuming the passed strings will have unique first characters)? > TSuit = (Hearts, Spades, Diamonds, Clubs) using a deck of cards as a trivial example, instead of this: > One way is to have a parallel ordinal or enumerated value to test in the > What is the recommended way to use the "Case Of" structure when ("Wayne Niddery" wrote in "Gilles Ganault" wrote in message Wayne Niddery - TeamB (Tips to Get Published: SuitList.CommaText := 'Hearts, Spades, Diamonds, Clubs' To add the strings to and then use the lookup index in the case: If this is no good for some reason then another way is to use a stringlist TSuitNames = array of string = ('Hearts', 'Spades', 'Diamonds', TSuit = (Hearts, Spades, Diamonds, Clubs) One way is to have a parallel ordinal or enumerated value to test in theĬase. > I found the following samples but would like to know if there's a "Gilles Ganault" wrote in What is the recommended way to use the "Case Of" structure when
