MODULE DFFR; IMPORT InOut, Strings, NumConv, TextIO, Arguments; TYPE Identifier = ARRAY [0..31] OF CHAR; VAR old, new : Identifier; nr : CARDINAL; line : ARRAY [0..81] OF CHAR; tmp : ARRAY [0..7] OF CHAR; ok : BOOLEAN; file : TextIO.File; buffer : Arguments.ArgTable; count : SHORTCARD; BEGIN nr := 1; Arguments.GetArgs (count, buffer); Strings.Assign (new, buffer^[1]^); TextIO.OpenOutput (file, "go"); LOOP InOut.ReadString (old); IF Strings.pos ('jpg', old) < HIGH (old) THEN line := "convert -resize 50% "; Strings.Append (line, old); Strings.Append (line, " F-"); Strings.Append (line, new); NumConv.Num2Str (nr, 10, tmp, ok); NumConv.AdjustWidth (tmp, 3, "0"); Strings.Append (line, tmp); Strings.Append (line, ".jpg"); TextIO.PutString (file, line); TextIO.PutLn (file); INC (nr); END; IF InOut.EOF () = TRUE THEN EXIT END; END; TextIO.PutLn (file); TextIO.Close (file); InOut.WriteString ("Done"); InOut.WriteLn END DFFR.