Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Borland Delphi > Lesson 6, Strin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3703 of 3852
Post > Topic >>

Lesson 6, Strings (Superb)

by "Skybuck Flying" <BloodyShame@[EMAIL PROTECTED] > Apr 19, 2008 at 07:38 AM

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.
 




 1 Posts in Topic:
Lesson 6, Strings (Superb)
"Skybuck Flying"  2008-04-19 07:38:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 0:10:28 CDT 2008.