 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
userabuser
Joined: 15 Jul 2006 Posts: 29
|
Posted: Wed Sep 19, 2007 5:29 am Post subject: ReadFile and stringsplit |
|
|
I'm attempting to read lines in a file and use those lines for WinClose, however, I don't seem to be getting the string split properly.
BTW, the reason I'm using fileread is so I don't have to open the file again until/unless it's edited.
| Code: |
FileRead, contents, windowkiller.ini
winkills = %contents%
StringSplit, KillerArray, winkills, `,
Loop, %KillerArray0%
{
windowtokill := KillerArray%a_index%
msgbox, 0, test, Line is %windowtokill%
IfWinExist, %windowtokill%
winclose
sleep 500
}
|
|
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Wed Sep 19, 2007 6:11 am Post subject: |
|
|
| Code: | FileRead, content, windowkiller.ini
Loop, Parse, content, `n
{
StringSplit, KillerArray, A_LoopField, =
MsgBox, 0, Test, Window is named %KillerArray2%
IfWinExist, %KillerArray2%
Winclose
Sleep 500
} |
|
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6856 Location: Pacific Northwest, US
|
Posted: Wed Sep 19, 2007 2:59 pm Post subject: |
|
|
please post an example windowkiller.ini that you expect to work. Also note that by giving it an ini name, you imply to some people the ini file format.
| Code: |
Loop, read, windowkiller.ini
{
IfWinExist, %A_LoopFileReadLine%
Winclose
Sleep 500
}
|
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|