(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 SysLoadFuncsmmbase = 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 SysClssay "[0m"
call beep 880, 250
say " CDPTXT.INI not found!"
say " Call "||progname||" from the drive where CDPTXT.INI is located"
say ""
exitendcall 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 SysClssay "[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 ""
exitendcall SysClscd. = ""
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 )
selectwhen 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
endsay ""
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 endcd. = ""
cd.0 = 0
endwhen 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 endotherwise nop
endendpage last modified: 2025-10-11; loaded in 0.0085 seconds