Var iList: Integer; tmpList: TStringList; Const ctScanPath = 'C:\Test\EDemo\Tmp'; Begin psExitCode:= 1; tmpList := Nil; // ... add your code here psListPaths(ctScanPath, '*.*', 0, tmpList); If Assigned(tmpList) Then Begin Try tmpList.QuoteChar := #0; tmpList.Delimiter := ';'; For iList := 0 to (tmpList.Count-1) Do tmpList.Strings[iList] := ExcludeTrailingPathDelimiter(tmpList.Strings[iList]); psVSA := tmpList.DelimitedText; Finally tmpList.Free; End; End; // Check psLogWrite(1,'', 'psVSA = ' + psVSA); If Trim(psVSA) = '' then psExitCode := 0; End.