Jump to content

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


Recommended Posts

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!

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

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.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...