×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




What you say is true, though I'd add that you can do the same thing in RPG just by overlaying a 1A field with a 3U 0 field in a data structure.

The problem with your approach, Vern (you knew this was coming, right?) is that EBCDIC letters aren't always contiguous. It's true that if you had A (EBCDIC 193) and you added 1, you'd get B (EBCDIC 194). However, if you had the letter I (EBCDIC 201) and you wanted to get J, you'd have to add 8 since J is EBCDIC 208. IMHO, it's easier to use an array when you increment instead of trying to use the numeric value of the letter.

I suppose you could convert you letter to Unicode (RPG's "C" data type) and add 1 there. Unicode letters are all contiguous, so that'd work better.. but it still seems like a lot of screwing around.

vhamberg@xxxxxxxxxxx wrote:
Do it in C - that does this kind of increment nicely, since it treats
characters as 1-byte integers, sort or - Scott will probably have to
correct me!! But you'd still want to separate the 2 sections, numeric
and alpha, and check ranges and overflows.

Actually I'm not kidding!! ;-)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 by midrange.com 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.