Global $Protokoll1=2 ; =2, dann wird protokolliert ; =0, dann wird nicht protokolliert $ProgrammName="Test" ; für Fehlerausschriften Protokoll("Anfang") ;------------------------------------------------------------------------- Local $feld1="" Local $feld2="" For $i=0 To 1000 $feld1=$feld1&"123456789012345678901234" Next For $i=0 To 1000 $feld2=$feld2&$feld1 Next Protokoll("vor1") Protokoll("vor2") StringReplace($feld2,1000,"abcdefg") Protokoll("nach1") Protokoll("nach2") Func Protokoll($protstelle) Global $protbegin Local $protpfad,$protdif, $protfile $protpfad=EnvGet("AU")&"\Protokoll.txt" If $Protokoll1<>0 Then If $Protokoll1=2 Then $protbegin = TimerInit() $protdif=0 FileDelete($protpfad) Else $protdif = TimerDiff($protbegin) Endif $protfile = FileOpen($protpfad, $Protokoll1) If $protfile=-1 Then xbox("Fehler open Protokoll") If $Protokoll1=2 Then FileWrite($protfile,"Programmname: "&$Programmname& @CRLF) FileWrite($protfile, @YEAR&"/"&@MON&"/"&@MDAY&" "&@HOUR&"/"&@MIN&"/"&@SEC& @CRLF) Endif FileWrite($protfile, StringLeft ($protdif/1000,8)&" "&$protstelle & @CRLF) FileClose($protfile) $Protokoll1=1 If StringMid($protstelle,1,7)="**copy:" Then Run(@ComSpec & " /c " & 'copy ""'&$protpfad&'"" '&StringMid($protstelle,8)) EndIf Endif EndFunc