• Support
  • Articles
  • Resources
  • Products

How to print the number of looped in TTL macro

Moderator: boris

3 postsPage 1 of 1

karthi344
Newbie

Posts:
2
Joined: Tue Jan 10, 2017 12:30 pm
by karthi344 » Tue Jan 10, 2017 12:36 pm
All

I'm using TTL script for loop testing. My code looks like this:

Code: Select all

  1. no_of_loops = 500
  2.  
  3. while no_of_loops > 0
  4.     mtimeout = 20000
  5.     sendln 'CR 1 IN 1 ST 1'
  6.     mtimeout = 20000
  7.     wait 'OK' 'ERROR'
  8.     sendln 'SP 1 DN 1 DT 1'
  9.     mtimeout = 20000
  10.     wait 'OK' 'ERROR'
  11.     no_of_loops = no_of_loops - 1
  12. endwhile


My question is how I'll get to know current loop number. Please let me know and it would be appreciated.
Trevor
Guru

Posts:
474
Joined: Wed Jul 26, 2006 8:47 am
by Trevor » Tue Jan 10, 2017 4:08 pm
You could put something like this in the loop to have a status box display the loop counter:

Code: Select all

  1. sprintf2 status "no_of_loops = %d" no_of_loops
  2. statusbox status "Status"
  3.  
"
boris
Moderator, LogMeTT and TTLEditor developer

Posts:
1593
Joined: Sat Jan 08, 2005 2:52 pm
by boris » Tue Jan 10, 2017 5:31 pm
statusbox command description here http://ttssh2.osdn.jp/manual/en/macro/c ... usbox.html contains infinite loop example that should help you.
Thanks.
Best regards,
Boris
Display posts from previous:
Sort by:

3 postsPage 1 of 1

Users browsing this forum: No registered users
cron