Match ist immer True

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Match ist immer True

Re: Match ist immer True

Post by KHA » 11 Feb 2019, 19:10

Yeah! es funktioniert jetzt.
match muss innerhalb des Loop

Match ist immer True

Post by KHA » 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.

Top