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 > Pascal Misc > Re: freepascal ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 19 of 19 Topic 718 of 806
Post > Topic >>

Re: freepascal strings

by "Richard Engebretson" <eng@[EMAIL PROTECTED] > Feb 19, 2007 at 01:15 PM

On Feb 19, 2:19 pm, Wolf Behrenhoff
<NoSpamPleaseButThisIsVal...@[EMAIL PROTECTED]
> wrote:
> Richard Engebretson schrieb:
>
> > I am running your test on a linux virtual console using nr:longint.
> > Still running after over 125,000 recursions. Don't know ?? 175,000 ...
> > snorrr :-)
>
> Oh! That's interesting!
>
> I did the test under Windows XP (str=string[100])
>
> Turbo Pascal: 140 recursions (depends on the -M setting)
> Free Pascal: 3455 recursions (depends on the -Cs setting)
>
> But 175,000? A difference in three orders of magnitude? Something must
> be VERY different!
>
> Wolf
Test program:

type
 str=string[100]; (* change the number *)

procedure foo(nr: integer; s:str);
begin
  writeln(nr);
  foo(nr+1, s);
end;

var
  s:str;
begin
  foo(0,s);
end.

+++++++++++++
here is my version;

program test_string ;
type test_strings = string[100] ;
procedure number_of_recursions(nr:longint ; s:test_strings);
    begin
    writeln(nr);
    number_of_recursions(nr+1,s);
    end;

var s:test_strings;
begin
    number_of_recursions(0,s);
end.

I hope I did that right.

Anyway, it didn't stop on its own, I pressed Control-C (linux
interrupt). I didn't want my machine to eat itself. I've had my
SuSE8.1 linux machine running flawlessly for 3 months in spite of my
freepascal programming. Try that on Windows :-)

Big thanks,
Rick.
 




 19 Posts in Topic:
freepascal strings
"Richard Engebretson  2007-02-17 19:16:39 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-18 14:01:05 
Re: freepascal strings
"Richard Engebretson  2007-02-19 03:13:17 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-19 15:22:41 
Re: freepascal strings
CBFalconer <cbfalconer  2007-02-19 19:04:06 
Re: freepascal strings
"Richard Engebretson  2007-02-19 09:09:46 
Re: freepascal strings
Marco van de Voort <ma  2007-02-19 20:41:13 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-19 22:09:24 
Re: freepascal strings
Marco van de Voort <ma  2007-02-20 08:38:07 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-20 13:58:34 
Re: freepascal strings
Jonas Maebe <Jonas.Mae  2007-02-20 14:58:14 
Re: freepascal strings
"Richard Engebretson  2007-02-19 09:37:20 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-19 21:19:34 
Re: freepascal strings
Marco van de Voort <ma  2007-02-19 20:43:07 
Re: freepascal strings
Wolf Behrenhoff <NoSpa  2007-02-19 21:56:35 
Re: freepascal strings
Marco van de Voort <ma  2007-02-19 21:19:37 
Re: freepascal strings
Marco van de Voort <ma  2007-02-19 21:27:00 
Re: freepascal strings
CBFalconer <cbfalconer  2007-02-19 19:07:59 
Re: freepascal strings
"Richard Engebretson  2007-02-19 13:15:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Jul 6 6:30:42 CDT 2008.