Sign in to follow this  
Followers 0
xuzo

Simple loop syntax question to loop a send in single text file

4 posts in this topic

Can't figure out the type of loop I need for this...I need 5 loops, where do I put the 5, where do I put the "For" or the "Next" or are they even the proper syntax! :D

Here is my pathetic attempt:

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
For = 5
Send("This text is line A that I want to repeat 5 times as a loop.")
Send(@LF)
Next

Hope you guys understant what I mean!

Share this post


Link to post
Share on other sites



Something like this?

Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
For $i = 1 to 5
    Send("This text is line A that I want to repeat 5 times as a loop." & @LF)
Next

As this is basic scripting I would suggest to read the AutoIt tutorials in the Wiki and the help file to get a better understanding of the language.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi Water,

Actually I do read all the info, I actually have it on my Kindle.

Problem is for me this is so new, imagine learning Chinese and trying to learn "Hello how are you?" while you can't even say "hello"!

But I'm starting to figure things out, that example you gave me is crystal clear, I find the help files are too complicated with incremental variables and so on.

For me KISS is best to learn, just like what you gave me on top, now I get it!

Thanks

Share this post


Link to post
Share on other sites

I already started with "Ni hao" (hello) or even "Ni hao ma" ("how are you doing today?") :D

I would suggest to start with the Wiki. Here you find excellent tutorials and references.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0