Jump to content
Sign in to follow this  
xuzo

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

Recommended Posts

xuzo

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
water

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 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
xuzo

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
water

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.

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
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  

×