You might like to quess the answer to the following question.
Given:
var
StrArray : Array of String;
x : String;
const
FS = #29;
Routine 1
for i := 0 to high(StrArray) do
x := x + StrArray[i] + FS;
Routine 2
for i := 0 to high(StrArray) do
begin
x := x + StrArray[i];
x := x + FS;
end;
What are the relative times for Routine 1 and Routine 2 for StrArray being :
a. 10,000 Strings of 200 characters
b. 100,000 Strings of 200 characters
c. 1,000,000 Strings of 20 characters
The closest guess gets a virtual chocolate fish - no coding allowed :-)
When you've worked it out - could someone explain this in simple terms ?
Stephen
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"