Looping with no predefined end?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Looping with no predefined end?

Post by ADP_MAN » Tue Jul 20, 2004 3:56 pm


User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jul 20, 2004 4:37 pm

Try something like this:
Let>k=0
Repeat>k
Add>k,1
ReadLN>file,k,result
If>%result%=END,Stop

....Do Process A
Until>k,6

Label>Stop
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Post by ADP_MAN » Tue Jul 20, 2004 7:44 pm

Ok, Im using some code that looks like this:


//ADD "TD" TO THE LINE NUMBERS
Let>count=0
Label>Loop
ReadLn>file,count,result
If>%result%=END,stop
Press Down
Send Character/Text>TD
Press Home
Message>result
Wait>1
Let>count=%count%+1
Goto>Loop
Label>stop

Using the "Message" command I can see it sifting through the file. Unfortunately I can't seem to get the "TD" in front of the Reference numbers. Can you open the file and "ReadLN" through it or does it have to be closed for "ReadLN" to work?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 21, 2004 12:37 am

See the changes in red.
//ADD "TD" TO THE LINE NUMBERS

Let>count=1
Label>Loop
ReadLn>file,count,result
If>%result%=END,stop
Let>result=TD%result%
Message>%result%
Wait>1
Let>count=%count%+1
Goto>Loop

Label>stop
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

ADP_MAN
Junior Coder
Posts: 45
Joined: Wed Apr 07, 2004 2:04 pm

Post by ADP_MAN » Wed Jul 21, 2004 3:37 pm

This looks great! Thanks!

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