about check number heuristics
Derek Atkins
warlord at MIT.EDU
Tue Jan 30 10:23:50 EST 2007
Chris <cxl000 at hotmail.com> writes:
>> Too complex? Any hard impacts on GC as it is now?
>> Comments please (if this deserves any!).
Yeah, I think this is way too complex...
>> 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 " ,."
No, I dont think it needs to be that complicated.
> 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.
I think it just needs to skip over all non-numeric until the end; we
only need to deal with strings of the form "c*d+", where we have any
number (including zero) of leading alpha-numerics, followed by at
least one digit. Then we just need to keep the same minimum number of
digits in the increment, and leave the "c*" substring alone.
For example:
000123 -> 000124
A999 -> A1000
0A1C999 -> 0A1C1000
I don't think it needs to be any more configurable than this.
> Regards,
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list