a string problem

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
james123
Newbie
Posts: 6
Joined: Sun Dec 31, 2006 6:57 pm

a string problem

Post by james123 » Tue Jan 02, 2007 8:12 pm

how do i add 1 to "001" string so after each time it goes through the loop it will go up by one.
like that :

001
002
...
...
010
...
...
192
... untill 260.

i have to keep the zeroes at the beginning and this is yits important that it will stay as a string.


nvm i made something up.. if any1 needs:

let>x=1



label>start


Length>%x%,Len
if>len=1
let>x=00%x%
endif
if>len=2
let>x=0%x%
endif

let>x=x+1
if>x=161
let>x=0
endif

goto>start

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 02, 2007 10:59 pm

Here's one way:

Code: Select all

VBSTART
VBEND

Let>k=0
Repeat>k
  Let>k=k+1
  VBEval>Right("00" & "%k%",3),PaddedK
  Message>PaddedK
Until>k=20
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 02, 2007 11:24 pm

Another (non-VB) method is discussed here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts