Robert Munday escribió:
Without using arrays (I can do that), is there a way to increment a character value?
CHAR = 'A';
CHAR += 1;
does not work, but is there something similar which would? I am adding a two-character suffix to a field which increments `AA`, `AB`, `AC` etc.
Robert, a similar problem (kind of...) back in May had lots of posts.
I contributed with one post (in the archive)

which I called "AlphaMath". I must admit not many people thought it was a good solution, but...
In that post, the "code" was 4 positions, KLMN, ... K, L being alpha A-Z, but M, N numeric 0-9
Your case, the "suffix" is only 2 positions and will go from 'AA' to 'ZZ', which gives 676 combinations (26x26). Am I right?
This should be easier, but similar.
counter = 0 (Starting a counter from 0...)
j = counter\26 (integer division !)
i = counter mod 26 (remainder prom previous integer division!)
First suffix letter = Table, with displacement "i"
Second suffix letter = Table, with displacement "j"
counter = counter + 1 </loop>


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].