Jump to content
Macro Express Forums

Increment Integers With Zero's


johnboy691
 Share

Recommended Posts

I have a 13 digit number that I copy to a text variable from excel. I then modifiy it to seperate sections as ME won't calculate numbers larger than 10 characters. I have trouble when I modify these back together. For example: on the number 6590600110158 where 659 is a location, 06 is the year, 001 is the Julian date and 10158 is the sequence number. If I crop it between the end of the Julian date and the begining of the sequence number, increment it and then put it back together, everything is ok. BUT, if the end of the Julian date is like 200 or 210 (has ending zero's) and/or the sequence number is 00098 (beginning zeors). It doesn't put my number back together correctly, it leaves out the zeros. How do I get this to merge back together correctly? For example: copied number 6590636509998 comes back with a value of 659063659999 only a 12 digit number and no zero after the 365.

 

Example below of my scripting.

variable modify string: Copy part of %T82% to %T83%

THE ABOVE LINE COPYS THE LOCATION, YEAR, JULIAN DATE

variable modify string: Copy part of %T82% to %T84%

THE ABOVE LINE COPYS THE SEQUENCE NUMBER

variable modify string: convert %t84% to integer %N4%

THE ABOVE LINE CHANGES SEQUENCE NUMBER TO AN INTGER

variable modify integer: Inc (%N4%)

THE ABOVE LINE INCREMENTS THE SEQUENCE NUMBER

varable modify integer: Convert %N4% to text string %T85%

THE ABOVE LINE CONVERTS INTEGER BACK TO A STRING

variable modify string: Append %T85% to %T83%

THE ABOVE LINE APENDS THE INCREMENTED SEQUENCE NUMBER BACK

variable modify string: Append %T83% to %T37%

THE ABOVE LINE CHANGES THE VARIABLE TO THE ONE USED IN THE RES OF THE SCRIPT.

Variable modify string: Trim %T37%

 

Thanks for any help you can give.

John

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...