Loop parse

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
volfx
Posts: 33
Joined: 26 Oct 2016, 03:51

Loop parse

07 Jun 2017, 12:58

I find this working code

Code: Select all

Loop, Read, %A_ScriptDir%\TheBeatles-Lyrics.txt
		Loop, Parse, A_LoopReadLine, %A_Space%
		{
			if A_Index=1												
			{
			code
			}
		}
but now i need parse from variable for example Variable1

Code: Select all

Loop, Read,Variable1
		Loop, Parse, A_LoopReadLine, %A_Space%
		{
			if A_Index=1												
			{
			code
			}
		}
but this doesnt work..
User avatar
fischgeek
Posts: 435
Joined: 29 Jan 2014, 21:39

Re: Loop parse

07 Jun 2017, 14:00

What are the contents of Variable1? Is it a file path to a file or something else. Loop, Read reads a file. If something else you're looking for a different kind of loop.
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Loop parse

07 Jun 2017, 14:00

example ( delimiter is space )

Code: Select all

aa=This is an example
Loop, Parse, aa,%a_space%
{
x:=a_loopfield
if a_index=1
   {
   msgbox,%x%
   continue
   }
e .= x . "`r`n"
}
msgbox,%e%
e=
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: inseption86, jaka1, LuckyJoe, metallizer, Rohwedder and 333 guests