Re: [fpc-pascal] Comparing version numbers

2006-06-04 Thread Graeme Geldenhuys
On 6/3/06, L505 <[EMAIL PROTECTED]> wrote: You simply can't always write tests *before* you develop your program because this is too much design up front. If you know all the tests you should write before you even *have A am afraid you are very misguided about what Test Driven Development act

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread L505
> On 6/3/06, Jilani Khaldi <[EMAIL PROTECTED]> wrote: > > > Learn to code with UnitTests (process is called Test Driven > > > Development). > > > > Never used. How does this work? I found only a unit called > > "UnitTests.pp" and nothing else. > > Use an xUnit testing framework while coding. Free

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread A.J. Venter
> Regarding TDD (Test Driven Development) look at the following websites: > In short - You write a test, Write the code, Run the tests, Refactor. > Then repeat the whole process... The first 3 steps should be > completed in under a minute. As I said, it is very different to > traditional program

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread Graeme Geldenhuys
On 6/3/06, Jilani Khaldi <[EMAIL PROTECTED]> wrote: > Learn to code with UnitTests (process is called Test Driven > Development). Never used. How does this work? I found only a unit called "UnitTests.pp" and nothing else. Use an xUnit testing framework while coding. Free Pascal comes with fpc

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread Dean Zobec
Jilani Khaldi wrote: > >> Learn to code with UnitTests (process is called Test Driven >> Development). > > Never used. How does this work? I found only a unit called > "UnitTests.pp" and nothing else. > Thank you. The first article that started the practice, written by Kent Beck and Erich Gamm

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread Jilani Khaldi
Learn to code with UnitTests (process is called Test Driven Development). Never used. How does this work? I found only a unit called "UnitTests.pp" and nothing else. Thank you. jk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:/

Re: [fpc-pascal] Comparing version numbers

2006-06-03 Thread Graeme Geldenhuys
On 6/3/06, A.J. Venter <[EMAIL PROTECTED]> wrote: The debian version on the other hand is well over 200 lines of code by itself, and I am not entirely sure my version is going to be stable on all testdata yet. Learn to code with UnitTests (process is called Test Driven Development). I have to

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread A.J. Venter
> > Your code can't work with these ones, 4.1.15 and 4.12.1 because you > only pad the 3rd (15 and 1), you need to pad each part of the > version, my pseudocode out 4.1[space].15 and 4.12.1[space]. You can > call your function with the 4,4; again with 12,1 utnil you get a > result but you nee

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread Felipe Monteiro de Carvalho
On 6/2/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: Split the version string in several numbers: version := '4.0.12'; major := 4 minor := 0; patch := 12; I think this is the winner solution. But you don´t have to do this: versionnumber := major * 1 + minor * 100 + patch It´s better

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread A.J. Venter
> Your code can't work with these ones, 4.1.15 and 4.12.1 because you > only pad the 3rd (15 and 1), you need to pad each part of the > version, my pseudocode out 4.1[space].15 and 4.12.1[space]. You can > call your function with the 4,4; again with 12,1 utnil you get a > result but you need a

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread Eduardo
At 01:41 03/06/2006, you wrote: > Simple, just a variation of your first try. Use ASCII comparation, > but all parts must have the same digits, in your case, you padd the > 3rd part (or any part) with any letter down the ascii code of 0, for > example ' ' (a space) This was a brilliant idea as f

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread A.J. Venter
> Simple, just a variation of your first try. Use ASCII comparation, > but all parts must have the same digits, in your case, you padd the > 3rd part (or any part) with any letter down the ascii code of 0, for > example ' ' (a space) This was a brilliant idea as far as I can see. MUCH simpler than

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread Eduardo
At 23:03 02/06/2006, you wrote: I have tried about a dozen different algorithms now, and I admit to being stumped because everyone I've tried fails SOMEWHERE. The task before me is to compare version numbers of software packages and determine which is higher. First try was to simply do a string

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread A.J. Venter
Actually I found my answer just now after asking a friend who is a debian user. Turns out debian documents the pseudocode for their method in the manpages. So I am just busy translating the pseudo to pascal now. 1. take any initial string of non-digits from each, remove, and compare ASCIIbetica

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread Vincent Snijders
A.J. Venter wrote: So the question is: 1) does somebody HAVE an algorithm for this already ? 2) If not, can somebody give me a hint about what approach to take ? Split the version string in several numbers: version := '4.0.12'; major := 4 minor := 0; patch := 12; versionnumber := major * 1

Re: [fpc-pascal] Comparing version numbers

2006-06-02 Thread Marco van de Voort
> I have tried about a dozen different algorithms now, and I admit to being > stumped because everyone I've tried fails SOMEWHERE. > > The task before me is to compare version numbers of software packages and > determine which is higher. > First try was to simply do a string comparison. > This