Jump to content

AutoIT and lists - help


Recommended Posts

Hi all.

I'm making a new program, thats uses a list of a names. I saved them into ini file.

This is my question. How I can get AutoIT to read names from the list one-by-one.

Example ;

List:

Marry

Jane

Patric

Eric

I want to AutoIT read and use send function and make a loop of it, that

ex.

send("marry")

sleep(500)

send("Jane") ; next position from a list

sleep(500)

Send("Patric") ; next, the 3rd position

I hope that you understand me. Sorry 4 my crappy english

Wiz.

Edited by Wizath
Link to comment
Share on other sites

Hi all.

I'm making a new program, thats uses a list of a names. I saved them into ini file.

This is my question. How I can get AutoIT to read names from the list one-by-one.

Example ;

List:

Marry

Jane

Patric

Eric

I want to AutoIT read and use send function and make a loop of it, that

ex.

send("marry")

sleep(500)

send("Jane") ; next position from a list

sleep(500)

Send("Patric") ; next, the 3rd position

I hope that you understand me. Sorry 4 my crappy english

Wiz.

Post an example of the Ini file that you have.

Also take a look at IniReadSection() and using loops. They are both in the help file.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

hmm do I need to assign keys to my list ? I have simply put in the names in a section ;|

I hope that you understand me.

So IniReadSection("names", "", ?)

[names]

DaszekPL

bodulec

sir Anthony

RippeR

serwer

Gloriam

PARADOX

jarrock

kiepskiwaldus

snoopek

Xana

MYSYS

morganok

HITMAN

Asiaaa

Link to comment
Share on other sites

hmm do I need to assign keys to my list ? I have simply put in the names in a section ;|

I hope that you understand me.

So IniReadSection("names", "", ?)

[names]

DaszekPL

bodulec

sir Anthony

RippeR

serwer

Gloriam

PARADOX

jarrock

kiepskiwaldus

snoopek

Xana

MYSYS

morganok

HITMAN

Asiaaa

So what you really mean is you don't have them saved in a proprly structured ini file, just in a flat text file with the ini extension.

$aText = StringRegExp(FileRead("C:\MyFile.ini"), "(.*)(?:\v|\z)", 3)
For $i = 0 To Ubound($aText) -1
   MsgBox(0, "Test Result", $aText[$i])
Next
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks for help.

I was in the middle of posting something else for you when Jon pulled the wrong knob again and the forums went down so here you go.

If you have other "Sections" in that file then You might want to use something like this instead.

$aSec = StringRegExp(FileRead("C:\myfile.ini"), "(?i)(?s)\[names\]\v(.+?)(?:\[|$)", 1)
If NOT @Error Then
    $aText = StringRegExp(StringStripWS($aSec[0], 2), "(.*)(?:\v|\z)", 3)
    For $i = 0 To Ubound($aText) -1
        If $aText[$i] <> "" Then MsgBox(0, "Test Result", $aText[$i])
    Next
EndIf

This was written on the fly so some tuneup may be required.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...