|
Do you need to be able to choose an arbitrary letter, add an arbitrary number of letters, and get a result? If so, Booth's idea is probably the best. On the other hand, if you only need to be able to cycle through them in order, you can use an array and a for loop. Either way you are likely going to want to use an array (as others have suggested). Due to the way that computers represent characters, this is not always easy to do. Since everything in a (non-quantum) computer is represented in bits, you have to have a standard way of determining how to encode 'A' or 'B' (as well as a way of encoding 'a' and 'b', which is different than 'A' and 'B'). System i uses EBCDIC, which has multiple code pages, each of which could have a different . I'm guessing your default codepage is 37, since you seem to be located in Ontario. Code page 37 does not define the sequence A-Z in numerical order (see http://en.wikipedia.org/wiki/EBCDIC_037), so doing math with the binary representations is out. One of the array methods is better anyway, because it is consistent across different character representations. Hope this helps, Adam rpg400-l-bounces+aglauser=erbgroup.com@xxxxxxxxxxxx wrote on 29/05/2006 02:35:15 PM:
Does anyone know of a method to increment a character value . For instance I want to increase the value 'A' to be the value 'B'. ****************************************** Don Wereschuk ISD Associate - Programmer Simcoe Parts Service Inc. Phone: 705-435-7814 Ext.: 302 Fax: 705-435-6746 dwereschuk@xxxxxxxxxxxxxxx ****************************************** -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
##################################################################################### Attention: The above message and/or attachment(s) is private and confidential and is intended only for the people for which it is addressed. If you are not named in the address fields, ignore the contents and delete all the material. Thank you. Have a nice day. For more information on email virus scanning, security and content management, please contact administrator@xxxxxxxxxxxx #####################################################################################
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.