Changeset 74 for Generics/TemplateGenerics/Demo/UMainForm.pas
- Timestamp:
- Oct 28, 2010, 9:44:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Demo/UMainForm.pas
r73 r74 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, ListInteger, ListString, DictionaryString, QueueInteger ;9 ComCtrls, ListInteger, ListString, DictionaryString, QueueInteger, ListChar; 10 10 11 11 type … … 14 14 15 15 TMainForm = class(TForm) 16 ButtonCharList: TButton; 16 17 ButtonQueueInteger: TButton; 17 18 ButtonDictionaryString: TButton; … … 19 20 ButtonStringList: TButton; 20 21 MemoOutput: TMemo; 22 procedure ButtonCharListClick(Sender: TObject); 21 23 procedure ButtonDictionaryStringClick(Sender: TObject); 22 24 procedure ButtonIntegerListClick(Sender: TObject); … … 123 125 end; 124 126 127 function CharToStr(Value: Char): string; 128 begin 129 Result := Value; 130 end; 131 132 procedure TMainForm.ButtonCharListClick(Sender: TObject); 133 var 134 List: TListChar; 135 begin 136 MemoOutput.Clear; 137 WriteLn('TListChar test'); 138 List := TListChar.Create; 139 with List do try 140 AddArray([' ', ' ', 'A', 'b', 'c', 'd', ' ']); 141 WriteLn('Implode: ''' + Implode('', CharToStr) + ''''); 142 WriteLn('Implode: ' + Implode('', CharToStr)); 143 WriteLn('Reverse'); 144 Reverse; 145 WriteLn('Implode: ''' + Implode('', CharToStr) + ''''); 146 WriteLn('TrimLeft'); 147 TrimLeft; 148 WriteLn('Implode: ''' + Implode('', CharToStr) + ''''); 149 WriteLn('TrimRight'); 150 TrimRight; 151 WriteLn('Implode: ''' + Implode('', CharToStr) + ''''); 152 WriteLn('UpperCase'); 153 UpperCase; 154 WriteLn('Implode: ''' + Implode('', CharToStr) + ''''); 155 finally 156 Free; 157 end; 158 end; 159 125 160 function StrToStr(Value: string): string; 126 161 begin
Note:
See TracChangeset
for help on using the changeset viewer.