(view source code of cdadd.cmd as plain text)
/*
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º CDadd: Adds all CDs from a list (CDPTXT.INI) to CDP.INI º
º Written by Rob van der Woude º
º Latest revision: 1999/08/02 º
º This program needs CDlist.cmd to create CDPTXT.INI º
º Please feel free to use, distribute and modify this program. º
º However, do so entirely at your own risk. º
º The author cannot be held responsible for any damage or loss of data, º
º caused by the use or inability to use this program. º
º If you modify this program, please document the modifications. º
º I would also like to receive an e-mail message stating the nature of the º
º modifications. º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
*/
/* Initialize RexxUtil */
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs
mmbase = strip( value( "MMBASE", , "OS2ENVIRONMENT" ), "T", ";" )
cdpini = mmbase||"\CDPNEW.INI"
cdptxt = mmbase||"\CDPTXT.INI"
cdpbak = mmbase||"\CDPNEW.BAK"
call SysFileTree cdptxt, "found.", "F"
if found.0 <> 1 then do
call SysCls
say "[0m"
call beep 880, 250
say " CDPTXT.INI not found!"
say " Call "||progname||" from the drive where CDPTXT.INI is located"
say ""
exit
end
call SysFileTree cdpini, "exist.", "F", , "**---"
if exist.0 = 1 then do
call SysFileTree cdpbak, "exist.", "F", , "**---"
if exist.0 = 1 then address CMD "@CMD /C DEL "||cdpbak
address CMD "@CMD /C REN "||cdpini||" *.BAK"
end
/* Reset file */
call lineout cdptxt
inline = linein( cdptxt, 1, 1 )
/* Check header */
test1 = ";Tekst-versie van CDP.INI"
test2 = ";Text version of CDP.INI"
if inline <> test1 & inline <> test2 then do
call SysCls
say "[0m"
call beep 440, 250
call beep 880, 250
call beep 1760, 250
say " ERROR: the file "||cdptxt||" is invalid."
say ""
say " Correct the error and try again."
say ""
exit
end
call SysCls
cd. = ""
cd.0 = 0
Checksum = "Checksum"
IMMCDDiscTitle = "IMMCDDiscTitle"
IMMCDDiscProgram = "IMMCDDiscProgram"
/* Read and process the lines one by one */
do until lines( cdptxt ) = 0
inline = linein( cdptxt, , 1 )
select
when inline = "" & cd.Checksum <> "" then do
say "["||cd.Checksum||"]"
say "09"X||"IMMCDDiscTitle = "||cd.IMMCDDiscTitle
say "09"X||"IMMCDDiscProgram = "||cd.IMMCDDiscProgram
cd.0 = ( length( cd.IMMCDDiscProgram ) - 3 ) / 2
do i=1 to cd.0 by 1
say "09"X||i||" = "||cd.i
end
say ""
interpret 'cd.IMMCDDiscProgram = 'cd.IMMCDDiscProgram
call SysIni cdpini, cd.Checksum, "IMMCDDiscTitle", cd.IMMCDDiscTitle
call SysIni cdpini, cd.Checksum, "IMMCDDiscProgram", cd.IMMCDDiscProgram
do i=1 to cd.0 by 1
call SysIni cdpini, cd.Checksum, i, cd.i
end
cd. = ""
cd.0 = 0
end
when abbrev( inline, " " ) = 1 then do
cd_entry = strip( inline )
parse value cd_entry with key"="cdvalue
key = strip( key )
cdvalue = strip( cdvalue )
do forever
parse value cdvalue with lead"; "trail
if trail = "" then leave
cdvalue = lead||"0D0A"X||trail
end
cd.key = cdvalue
end
otherwise nop
end
end
page last modified: 2023-03-10