View previous topic :: :: View next topic

Author 
Message 
bismark928 Warnings : 1 New User
Joined: 03 Apr 2007 Posts: 1 Location: philippines




HI, PEOPLE!
COULD YOU HELP ME ON THIS ONE?....PLEASE..
GENERATE THE TRANSACTION NUMBER CODE THAT COMES AFTER THE LAST ERROR TRANSACTION NUMBER USED IN THE SAME RUN. THE NUMBER CODE SHOULD BE CONTINUOUS FOR EACH RUN. FOR EACH RUN, IT WILL START FROM '19' THEN 'AZ' THEN GOES TO '0' WITH THE NEXT CHARACTER ON THE LEFT INCREMENTING BY 1. THEN THE CHARACTER ON THE RIGHT WILL START AGAIN FROM '19' THEN 'AZ'.
THEN THE CHARACTER ON THE LEFT WILL INCREMENT BY 1 AND THE RIGHT CHARACTER WILL BECOME '0'.
EXAMPLE:
19, AZ, 1019, 1A1Z,2029,2A2Z,......9099,9A9Z,A0ZZ,100109,10A10A,110119,11A11Z,......190199,19A19Z,1A01A9....
1000ZZZZ.
ASSUME THAT THE TRANSACTION NUMBER CODE WILL NOT EXCEED ZZZZ FOR EACH RUN.
THANKS!!!
Warning: All Caps 

Back to top 




agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 686 Location: Earth




This seems to be a very interesting question. I remember to solve similar one in my Engineering.
This sequence number comsists of 36 symbols. I will call mod 36 number system. ( I am calling it a number system because I perceive this similar similar note to hex  16, decimal  10 , octal 8)
I would take some freedom to make change in this NUMBER system as follows.
Quote: 
09, AZ, 1019, ..... 
This will make our work easy.
Now,
0 in decimal is 0 in mod 36, 1 is 1 and 10 in decimal is A and similarly 35 in decimal is 'Z' in mod 36.
Getting some hint...?
Generate sequence number in decimal only and 'convert' it in to your mod 36 number.
This you can do by dividing decimal number by 36 ( method should be similar to decimal to hex conversion )
Example: 45 in decimal
45/36 = 1
9
So 45 decimal is 19( mod 36)
56 in decimal
56/36 = 1
20 (remainder) = J so 56 (mod 10 ) = 1J (mod 36)
If anyone has different/easier approach, I will eagerly wait for reply. 

Back to top 


dick scherrer
Site Director
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix




Hello,
Sounds good to me
As a possible continuation to the posted solution, you might make an array of 1byte entries that contain the values zero thru zee (0Z). When you divide by 36, use the remainder of the divide as a displacement into that array to quickly get your mod36 "units" position. 

Back to top 



