MyChat Scripts: property TStringList.Sorted, enable/disable string sorting
Enabling/disabling string sorting by alphabetical order.
Syntax
property TStringList.Sorted: boolean;
Result
"True" if the list needs to be sorted, "False" if not.
Example
const
DATA = 'Year one was lots of fun'#13#10 +
'But nothin'' lasts forever in my dreams'#13#10 +
'Two, I followed you'#13#10 +
'Because you knew the way or so it seemed'#13#10 +
'At three, I still believed'#13#10 +
'That we would be becoming destiny'#13#10 +
'At four l wanted more'#13#10 +
'But you were movin'' on to better things';
var
SL: TStringList;
begin
SL := TStringList.Create;
SL.Text := DATA;
mLogScript(CRLF + SL.Text, 'unsorted');
SL.Sorted := true;
mLogScript(CRLF + SL.Text, 'sorted');
SL.Free;
end.
Script work result
[23:57:16] (Log "SortedProperty"): [unsorted]
Year one was lots of fun
But nothin' lasts forever in my dreams
Two, I followed you
Because you knew the way or so it seemed
At three, I still believed
That we would be becoming destiny
At four l wanted more
But you were movin' on to better things
[23:57:16] (Log "SortedProperty"): [sorted]
At four l wanted more
At three, I still believed
Because you knew the way or so it seemed
But nothin' lasts forever in my dreams
But you were movin' on to better things
That we would be becoming destiny
Two, I followed you
Year one was lots of fun
[23:57:16] (Run "SortedProperty"): Script operation time: 5 ms
[23:57:16] (Run "SortedProperty"): Script done successfully.
See also
Created with the Personal Edition of HelpNDoc: Experience the Power and Simplicity of HelpNDoc's User Interface