views:

104

answers:

1

My code is exactly like the example in the help file:

myStrings := TStringList.Create; myStrings.Sorted := True; myStrings.Duplicates := dupIgnore;

The compiler tells me that both "sorted" and "Duplicates" are undeclared identifiers.

But, how can that be if it correctly reconizes the TStringList.Create? I have not redifined stringList classes any where else. It is a simple testing stub that has the absolute minimum components in order to test a specific tecnique... uses Classes, Windows and Dialogs--in that order.

+6  A: 

I think that myString is declared as TStrings

var myStrings: TStrings; //From second Comment

Declare that as TStringList

var myStrings: TStringList; 
Bharat
Or type-cast: TStringList(myStrings).Sorted := ...;
Remy Lebeau - TeamB