about check number heuristics

Chris cxl000 at hotmail.com
Mon Jan 29 16:44:47 EST 2007


On Fri, 2007-01-26 at 14:59 -0200, Ethy H. Brito wrote:
> On Thu, 25 Jan 2007 10:00:54 -0500
> Derek Atkins <warlord at MIT.EDU> wrote:
> 
> > >> Are you offering to code this and send in a patch?  :-D
> > >>
> > >
> > > yes I am. In fact I am working on the idea reading the code to catch your
> > > programing style and propose something that fits in.
> > 
> > Cool!  I look forward to your patch.  :)
> 
> Here go my thoughts:
> 
> I think the "problem" has to be dealed at check number increment/decrement.
> If this is done correctly, the import matching do not have to be smart
> (a simple str[n]cmp will do the job as it is today)
> Please correct me. I have no deep knowledge of GC innards.
> 
> Then I thought about a print function.
> It may deal with some format string and parse whatever the user writes, formatting accordingly something like this:
> 
> 1- print numbers against a (C like) pattern
> 
>       c - alfabetic chars from A to Z
>       h - alfabetic chars from 0 to 9 and from A to F
>       d - alfabetic chars from 0 to 9
>       u - a user defined ASCII sequence (in any order) up to 36 chars
> 
>       As examples printing decimal number 123 under the format string:
>          "dddddd"       -> 000123 
>          "dddcdddddd"   -> 000A000123 (also number 123. "A" is equiv. to 0)
>          
>       In this last example we have three groups:
>          the first with 3 digits
>          the secont: a single alphabetic char
>          the third: 6 digits
> 
> 2-    Each group of identical type will be inc/decremented separately 
>       adding the carry bit from the group at its left
> 
>       For instance the format string "ddd ccddd" will give us 
>       "000 ZZ999" + 1 = "001 AA000" 
>       (just for fun: don't have any ideia what "000 ZZ999" decimal number is)
> 
> 3-    Some flags may controls when strip leading zeroes from target or
>       to honor the carry from previous operations.
> 
> 4-    Overflows/wrapping are governed by each field length
> 
> Too complex? Any hard impacts on GC as it is now?
> Comments please (if this deserves any!).
> 
> Ethy
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> 
   Would a full automagical increment need to deal with locale.
If so have a localized order string "0123456789ABC...Z0" and a skip
string " ,."
Iterate over each character in reverse numerical order skipping over
character in the skip string indexing into the string and take the next
character. If you wrap to "0" increment the next character else add the
rest of the string. if you reach the end of the string and need to
increment with an overflow add a "1".

I'm willing to code up a patch, I just prefer to have agreement on
specifications before I start.

Regards,



More information about the gnucash-devel mailing list