Program adjust; {$M 8192,0,0} { Leave memory for child process } uses crt,dos,open; var c1, c2 ,i : byte; code : integer; {--------------------------------------------------------------} procedure adjust256Colour(filename:string;colour1,colour2:byte); var source,dest : File of byte; data : byte; begin assign(source,filename+'.img'); reset(source); assign(dest,filename+'.adj'); rewrite(dest); repeat read(source,data); if data=colour1 then data:=colour2; write(dest,data); until eof(source); close(dest); close(source); Exec_Dos_Command('del '+paramstr(1)+'.img'); Exec_Dos_Command('rename '+paramstr(1)+'.adj '+paramstr(1)+'.img'); end; begin Val(ParamStr(2), c1, code); Val(ParamStr(3), c2, code); if does_file_exist(paramstr(1)+'.img') and (c1>-1) and (c1<256) and (c2>-1) and (c2<256)then begin adjust256colour(paramstr(1),c1,c2); writeln(paramstr(1),'.img colour:',c1,' adjusted to ',c2); end; if (paramstr(1)<>'') and (paramstr(1)<>'/?') then if Does_File_Exist(paramstr(1)+'.img')=false then writeln('File Not Found!'); if (c1<-1) or (c1>256) and (c2<-1) or (c2>256) then writeln('Colour out of range!'); if (paramstr(1)='') or (paramstr(1)='/?') then begin writeln; writeln('ADJIMG Written By Franz Ayestaran (c)1997'); writeln('------'); writeln('This Program finds and changes the current value'); writeln('of colour1 to the new value of colour2.'); writeln; writeln('adjimg '); writeln; end; end.