Match ist immer True

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

KHA
Posts: 403
Joined: 21 Aug 2018, 11:11

Match ist immer True

11 Feb 2019, 17:29

Hallo,
möchte folgendes erreichen, überprüfen ob die Nr in der Liste existiert dann die entsprechende stelle mit bestimmen sonst soll "Nicht vorhanden" geschrieben werden, doch Match ist immer True. Auch wenn die Nr in der Liste nicht existieren.

Code: Select all

NewEk=
(
1456	19,99
6541	18,50
98745	15,99

)

FormatTime, datum,, dd.M.yyyy


FileRead, list, ean.txt


Match := 0
Loop, Parse, NewEk, `n
{
if (A_Loopfield = "")
break


preisstrsplt := StrSplit(A_LoopField, "`t")
erstnr = % preisstrsplt[1]
zweitnr = % preisstrsplt[2]

Loop, Parse, list, `n
{

	If InStr(A_Loopfield, erstnr)
	{
	newean :=  SubStr(A_LoopField, 9, 22)
	newean := Trim(newean, "`r")

	FileAppend, %newean%`t%zweitnr%`t%datum%`n, erg.txt
	Match := 1
	break
	}

}

if (Match = 0)
{
FileAppend, "Nicht vorhande"`t%zweitnr%`t%datum%`n, erg.txt
}

}
ToolTip, Suche Beendet
sleep, 2500
Tooltip

ExitApp
Danke schon mal für Antworten.
KHA
Posts: 403
Joined: 21 Aug 2018, 11:11

Re: Match ist immer True

11 Feb 2019, 19:10

Yeah! es funktioniert jetzt.
match muss innerhalb des Loop

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 24 guests