Hello.

I've made a script that compares information from AD with information from a txt-file (that has collected info from AD in previos steps).

I want the script to detect whether info has changed, and then run commands if change has been detected.

The txt-file collects various information, totally consisting of 6 lines (each line finished with CR), allthough the file has even more lines after what needs to be checked. That's why I've used the counter.

Reading this info with readline is ok, but what I can't accomplish is to detect if one of the lines is empty, and then compare with that field in AD (which has got new information), and when f.ex a field has got info, stuff needs to be done.

I could have written a bunch of if/endif's, but there's gotta be easier ways.. Maybe one solution is to use an ini-file?

As you can see, what I have right now, is only a check that detects changes - with a bunch of or-syntaxes. This method leads to empty lines to fall through.

 Code:
if open (8, $Log + "\user\" + @userid + ".txt") = 0
while @ERROR = 0 and $Counter < 7
	$Counter = $Counter + 1 ; Use $counter in addition to while because of the possibility to limit the count of lines to be checked
	$x = ReadLine(8)
	? "Line read: [" + $x + "]"
	 if $x = $strName or $x = $strTitle or $x = $strMail or $x = $strDepartment or $x = $strPhone or $x = $strMobile
	 $Change = "no"
   else
	 $Change = "yes"
	 $DoStuff = "yes"
	 $Tekst2 = $Tekst2 + $x + ", "
   Endif
Loop
	
EndIf
Close (8)


So.. it's better to ask you guys if you've got any directions.

Regards


Edited by Curious (2015-03-05 02:34 PM)
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..