Hello,
See comments or website for details:
http://members.home.nl/hbthouppermans/D2007Analysis/Index.htm
// *** Begin of AnalysisLesson6.dpr ***
program AnalysisLesson6;
{$APPTYPE CONSOLE}
{
Version 0.01 created on 19 april 2008 by Skybuck Flying
Lesson 6, Strings
Conclusion:
Delphi's String implementation is lightning fast compared to C/C++ STL's
string class.
Score:
10 out of 10
SUPERB.
}
uses
SysUtils;
procedure Main;
var
S : string;
begin
writeln('Program Started');
writeln;
S := 'Hello World !'; // 13 characters + 1 for null character, LIGHTNING
FAST, VERY GOOD.
// TEST 1
writeln( S ); // easy printing of strings to console.
// TEST 6
writeln( 'Length(S): ', Length(S) ); // result: 13, OK. Algorithm:
FAST/OPTIMAL. Length-Prefixed.
// TEST 8
S := S + ' How are you today ?'; // Result: 20 additional characters, for
a
total of 33, OK
// Algorithm: VERY FAST, CLEAR WINNER over C/C++ STL's String
implementation <- BLEH hahaha.
// TEST 9
writeln('Length(S): ', Length(S) ); // result: 33, OK.
writeln('Program finished');
end;
begin
try
Main;
except
on E:Exception do
Writeln(E.Classname, ': ', E.Message);
end;
readln;
end.
// *** End of AnalysisLesson6.dpr ***
Bye,
Skybuck.


|