Creating this VCL application consists of the following steps:
New
Other
Delphi Projects or C++Builder Projects and double-click the VCL Forms Application icon. The VCL Forms Designer displays.
var MyList: TStringList; Index: Integer;
TStringList *MyList;
int Index;
MyList := TStringList.Create; try MyList.Add('Animals'); MyList.Add('Flowers'); MyList.Add('Cars'); MyList.Sort; if MyList.Find('Flowers', Index) then begin ListBox1.Items.AddStrings(MyList); Label1.Caption := 'Flowers has an index value of ' + IntToStr(Index); end; finally MyList.Free; end;
MyList = new TStringList(); try { MyList->Add( "Animals" ); MyList->Add( "Flowers" ); MyList->Add( "Cars" ); MyList->Sort(); if( MyList->Find( "Flowers", Index ) { ListBox1–>Items->AddStrings( MyList ); Label1–>Caption = "Flowers has an index of " + IntToStr( Index ); } } __finally { MyList->Free(); }
Run to build and run the application. The form displays with the controls. |
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
|
What do you think about this topic? Send feedback!
|