Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-19-2007, 09:24 PM
Preeti.Dutta Preeti.Dutta is offline
Junior Member
 
Join Date: Oct 2007
Posts: 9
Default Indefinite Variable Loop Problem.

We are using AA 4.0 standard version.
Please consider the following demo task:
>Open "Notepad.exe"
>Loop While $counter$ less than or equal to "4".
> Keystroke: $counter$ in "Untitled-Notepad"
>End Loop

> Start Loop "4" Times
> Keystroke: $counter$ in "Untitled-Notepad"
>End Loop

this example has two Loops both loops are running indefinitly.
Reply With Quote
  #2 (permalink)  
Old 12-20-2007, 02:54 PM
Quincunx Quincunx is offline
Junior Member
 
Join Date: Dec 2007
Location: Oregon
Posts: 4
Default Advancing $counter?

Disclaimer: I am a complete noob to Automation Anywhere. The only reason I'm replying is because I still might have a half-way decent answer for you.

I haven't played with loops in Automation Anywhere yet, but in order for a loop to work the counter needs to advance each time the loop makes a run. The following is pseudo-code, but it should give you an idea.

Code:
$counter = 0
Loop while $counter < 4
     print $counter
     $counter = $counter + 1
End loop
Reply With Quote
  #3 (permalink)  
Old 12-22-2007, 12:18 AM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

System variable, counter increments by 1 when used within the loop so counter can only be used within the loop not in the Loop Condition command itself. However, you can use it in loop for number of times command. Following is the text format of commands, if you want to loop for 4 times,

Start Loop "4" Times
//write commands according to your requirement
End Loop

We have also attached task file (loopForTimes.atmn) for your convenience. You can copy it under following location, My Documents\Automation Anywhere\Automation Anywhere\My Tasks

Hope that helps.
Attached Files
File Type: atmn loopForTime.atmn (278 Bytes, 9 views)
Reply With Quote
  #4 (permalink)  
Old 12-28-2007, 04:05 AM
Preeti.Dutta Preeti.Dutta is offline
Junior Member
 
Join Date: Oct 2007
Posts: 9
Default

Thanks for solving my problem. So we should not use "Counter" variable in the conditional statements.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved