Sign in to follow this  
Followers 0
blakela

Variable Array & Do Loop

2 posts in this topic

I need to declare a variable array, such as a list of names, then do a loop applying each variable to the script until all variable have been used.

For instance:

Array: John, Mary, Bob, Alice

For x=1 to number of entries in array

do processing

repeat

Also is it possible to have this "array" be an external text file that I can edit outside of the script? That would allow me to compile my script and only edit the text file to add or take away names in the array.

Any ideas?

Share this post


Link to post
Share on other sites



Look at the help file and search for _FileReadToArray which reads a specified file into an array.

This is an example from the help file:

#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("error.log",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    Msgbox(0,'Record:' & $x, $aRecords[$x])
Next

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

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