[COLOR=green][B]Unter-Script "Parameter_Logging" :[/B][/COLOR]
[COLOR=green][B]dieses Script hat die Übergabe-Parameter "Beschreibung , alter_Wert , neuer_Wert"[/B][/COLOR]
[COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] fs , f , i , Verzeichnis , Ziel_Datei , Check
[COLOR=#0000ff][COLOR=#0000ff]Const[/COLOR][/COLOR] ForReading = 1, ForWriting = 2, ForAppending = 8
[COLOR=#008000][COLOR=#008000]' ----------------------------------------------------------[/COLOR]
[/COLOR]Check = alter_Wert - neuer_Wert
[COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] (Check > 0.00001) [COLOR=#0000ff][COLOR=#0000ff]Or[/COLOR][/COLOR] (Check < -0.00001) [COLOR=#0000ff][COLOR=#0000ff]Then[/COLOR]
[/COLOR][COLOR=#008000][COLOR=#008000]' ----------------------------------------------------------[/COLOR]
[/COLOR]Verzeichnis = [COLOR=#ff0000][COLOR=#ff0000]a_Daten_Verzeichnis[/COLOR][/COLOR] + "Logging\"
Ziel_Datei = Verzeichnis +_
"Log-File " + Right(Year(Now) ,4) + "-" + Right(100 + Month(Now) ,2) + ".csv"
[COLOR=#008000][COLOR=#008000]' Ziel-Verzeichnis schon vorhanden ?[/COLOR]
[COLOR=#008000]' ... wenn nein, dann erst erzeugen ...[/COLOR]
[/COLOR][COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] fs = CreateObject("Scripting.FileSystemObject")
[COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Not[/COLOR][/COLOR] fs.FolderExists (Verzeichnis) [COLOR=#0000ff][COLOR=#0000ff]Then[/COLOR]
[/COLOR]fs.CreateFolder (Verzeichnis)
[COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR]
[COLOR=#008000][COLOR=#008000]' Ziel-Datei schon vorhanden ?[/COLOR]
[COLOR=#008000]' ... wenn nein, dann erst erzeugen ...[/COLOR]
[/COLOR][COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Not[/COLOR][/COLOR] fs.FileExists (Ziel_Datei) [COLOR=#0000ff][COLOR=#0000ff]Then[/COLOR]
[/COLOR][COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] f = fs.OpenTextFile(Ziel_Datei , ForWriting, [COLOR=#0000ff][COLOR=#0000ff]true[/COLOR][/COLOR])
f.WriteLine " - Log-Daten Anlage " + [COLOR=#ff0000][COLOR=#ff0000]a_Anlage_Nummer[/COLOR]
[/COLOR][COLOR=#0000ff][COLOR=#0000ff]Else[/COLOR]
[/COLOR][COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] f = fs.OpenTextFile(Ziel_Datei , ForAppending)
[COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR]
f.Write Right(100 + Day(Now) ,2) & "." & Right(100 + Month(Now) ,2) & "." & Right(Year(Now) ,2) & " - "
f.Write Right(100 + Hour(Now) ,2) & ":" & Right(100 + Minute(Now) ,2) & ":" & Right(100 + Second(Now) ,2) & " - "
f.Write "Parameter »" & RTrim(Beschreibung) & "« geändert "
f.Write "von »" & [COLOR=#ff0000][COLOR=#ff0000]Chip_Person[/COLOR][/COLOR] & "« "
f.WriteLine "- alter Wert : " & CStr(alter_Wert) & " in neuen Wert : " & CStr(neuer_Wert)
f.Close
[COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR]
[/COLOR]