/* $VER: Dopus Mag. VersionCompare-Script 1.0 (10.11.1999) © by Wolfgang Breisch Requires VersionWB © by Håkan Parting Function: ARexx: VersionComp.dopus5 {Qp} COMPARE/S Compares the version of the selected file in source, with the same file in destination. If no destination is defined, or "COMPARE is not set, you get normal version-outputs of all selected files without comparing anything. */ options results options failat 99 parse arg dopusport ' ' cmd . if dopusport="" then exit address value dopusport LF='0a'x if cmd="COMPARE" then do lister query dest if RC>0 then cmd="" else do parse var result dhandle lister query dhandle path;dpath=strip(result, 'B', '"') end end lister query source stem shandle;if RC>0 then signal error do listloop=0 to shandle.count-1 lister query shandle.listloop selfiles stem sfiles lister query shandle.listloop path;spath=strip(result, 'B', '"') do selloop=0 to sfiles.count-1 lister set shandle.listloop busy on nosel=1 lister select shandle.listloop sfiles.selloop off;lister refresh shandle.listloop all sfile=strip(sfiles.selloop, 'B', '"') if cmd="COMPARE" then do lister set dhandle busy on Address Command 'C:VersionWB >t:Version.Tmp "'spath||sfile'" Text' Call extractver;selver=Result If ~Exists(dpath||sfile) Then Do;Call nofile;end else do Address Command 'C:VersionWB >t:Version.Tmp "'dpath||sfile'" Text' Call extractver;destver=Result call askuser end end else address command 'C:versionwb "'spath||sfile'"' end lister set shandle.listloop busy off end if nosel~=1 then signal error cancle: lister set shandle.listloop busy off if cmd="COMPARE" then do command delete 't:Version.tmp' quiet lister set dhandle busy off lister read dhandle dpath;lister refresh dhandle all end exit askuser: dopus request '"( 'spath||sfile' ) Version: 'selver||LF||LF'( 'dpath||sfile' ) Version: 'destver||LF||LF'Would you like to copy 'LF'( 'spath||sfile' ) to ( 'dpath' ) ?"' 'Copy|Skip|Quit' if RC=1 then do;command copy spath||sfile to dpath quiet;return;end if RC=0 then signal cancle return ExtractVer: Open('VerOut','T:Version.Tmp','Read') SearchLoop: If EOF('VerOut') Then Do Close('VerOut') Return('Unknown') End VerTmp=ReadLn('VerOut') If Left(VerTmp,9) ~= "Version: " Then Signal SearchLoop FoundVer: Version=Right(VerTmp,Length(VerTmp)-9) Close('VerOut') Return(Version) nofile: dopus request '"Source-File: ( 'sfile' )'LF'Version: 'selver||LF||LF'No file to compare in destination.'LF'Would you like to copy'LF'( 'sfile' ) to ( 'dpath' ) ?"' 'Copy|Skip|Quit' if RC=1 then do command copy spath||sfile to dpath quiet return end if RC=0 then signal cancle return error: dopus request '"No file selected."' 'OK' exit