Var iList: Integer; tmpList: TStringList; Begin psVSA := ''; psVSB := ''; psExitCode:= 0; // ... add your code here tmpList := TStringList.Create; Try tmpList.Delimiter := '_'; tmpList.StrictDelimiter := True; tmpList.QuoteChar := #0; tmpList.DelimitedText := psFilename; // Iterate If tmpList.Count > 2 Then begin For iList := 0 to (tmpList.Count-1) Do Begin Case iList of 0: psVSA := tmpList.Strings[0]; 1: psVSB := tmpList.Strings[1]; Else psVSB := psVSB + '_' + tmpList.Strings[iList]; End; End; // Debug psLogWrite(1, '', 'Project stripped: ' + psVSA + ', Filename stripped: ' + psVSB); End Else psLogWrite(1, '', 'Filename structure not correct, ' + psFilename); Finally tmpList.free; End; // Set ExitCode If (psVSA <> '') And (psVSB <> '') Then psExitCode := 1; End.