Re: [fpc-pascal] More Filter Madness

2011-10-16 Thread Jürgen Hestermann
Alberto Narduzzi schrieb: Recursion is for other things, such as expression parsing etc. where you don't (and neither possibly can't) actually know how deep may the nesting. Well, I would advice only to use it if you *know* the maximum nesting depth. Otherwise it can crash easily. A good

Re: [fpc-pascal] More Filter Madness

2011-10-16 Thread Alberto Narduzzi
Well, I would advice only to use it if you *know* the maximum nesting depth. Otherwise it can crash easily. I was not focusing on the problems that could arise using recursion, my point simply was that in this case, use of recursion was a no-need. Of course when using recursion you _MUST_

Re: [fpc-pascal] More Filter Madness

2011-10-15 Thread Jürgen Hestermann
Rich Saunders schrieb: On 10/14/11 2:39 AM, Nataraj S Narayan wrote: Good candidate for recursive algorithm i think. At first glance maybe, but it is actually a horrible candidate. That is due to the fact that the number of values is unknown and recursion has a built-in limit based on the

Re: [fpc-pascal] More Filter Madness

2011-10-15 Thread Alberto Narduzzi
Good candidate for recursive algorithm i think. At first glance maybe, but it is actually a horrible candidate. IMHO, this is far from being a problem that needs to be solved with recursion. Indeed, you don't need recursion at all: you have a file, and just need to sum its values till

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Nataraj S Narayan
Hi Good candidate for recursive algorithm i think. regards Nataraj On Fri, Oct 14, 2011 at 6:23 AM, Ko Hashiguchi ko.d.hashigu...@gmail.com wrote: Mine is more of a programming problem, rather than one native to Pascal, but here goes: I have a text file with many Double values. Looking

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Vincent Snijders
2011/10/14 Ko Hashiguchi ko.d.hashigu...@gmail.com: Mine is more of a programming problem, rather than one native to Pascal, but here goes: I have a text file with many Double values. Looking more or less like below, but with hundreds of entries... 1.5 3.25 7.54 10.33 2.22 The values

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Graeme Geldenhuys
On 14/10/2011 08:49, Vincent Snijders wrote: Depending on how many numbers you read and the difference between The original poster's questions sounds very much like a homework assignment, which you have no done for him. Naughty! Regards, - Graeme - -- fpGUI Toolkit - a

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Ko Hashiguchi
Hello Graeme, I'm way too old for homework, just to let you know. I'm five months younger than Steve Jobs and three months older than Bill Gates. Call me an old fart who just needed the help. Regards, Ko Hashiguchi On Fri, Oct 14, 2011 at 12:04 AM, Graeme Geldenhuys graemeg.li...@gmail.com

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Vincent Snijders
2011/10/14 Graeme Geldenhuys graemeg.li...@gmail.com: On 14/10/2011 08:49, Vincent Snijders wrote: Depending on how many numbers you read and the difference between The original poster's questions sounds very much like a homework assignment, which you have no done for him. Naughty!

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Graeme Geldenhuys
On 14/10/2011 09:09, Ko Hashiguchi wrote: Call me an old fart who just needed the help. Please accept my apology then. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Ko Hashiguchi
Graeme, No apology necessary. I am 56 years old, I have to (because of lack of money) write my own utilities, and I am too old to take up programming as a profession. But I am NOT too old to program! I just need help every now and then. I am the same Ko Hashiguchi who asked for help with

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Nataraj S Narayan
Hi Many of us from south Asian countries in here ought to be in their middles ages! I am 45. Since many of us might have started out in our late twenties in Delphi, natural progression to be here in fpc in our autumn days of life. regards Nataraj On Fri, Oct 14, 2011 at 8:30 AM, Ko Hashiguchi

Re: [fpc-pascal] More Filter Madness

2011-10-14 Thread Rich Saunders
On 10/14/11 2:39 AM, Nataraj S Narayan wrote: Good candidate for recursive algorithm i think. At first glance maybe, but it is actually a horrible candidate. That is due to the fact that the number of values is unknown and recursion has a built-in limit based on the stack size. So if your logic