(view source code of cdlist.cmd as plain text)
/*
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º CDlist: Creates a list of all CDs in CDP.INI and writes it to CDPTXT.INI º
º Written by Rob van der Woude º
º Latest revision: 1999/08/02 º
º Use this program together with CDadd.cmd to save (and edit if you like) º
º the list of CD titles and songs from MMOS2's CDP.INI in ASCII format. º
º 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
/* Find full path to MMOS2's CD Player's INI files */
mmbase = strip( value( "MMBASE", , "OS2ENVIRONMENT" ), "T", ";" )
cdpini = mmbase||"\CDP.INI"
cdptxt = mmbase||"\CDPTXT.INI"
cdpbak = mmbase||"\CDPTXT.BAK"
/* Check if CDP.INI exists */
call SysFileTree cdpini, "found.", "F"
if found.0 <> 1 then do
call SysCls
say "[0m"
call beep 880, 250
say " CDP.INI not found!"
say ""
exit
end
/* Check if ASCII version alreasy exists; if so, either delete or rename it */
call SysFileTree cdptxt, "exist.", "F", , "**---"
freq = 220
if exist.0 = 1 then do forever
call beep freq, 250
say "[0m"
say " File "||cdptxt||" already exists; do you want to [1mr[0mename it and create"
say " a new file or do you want to [1md[0melete the old file? [rd]"
call SysCurState "OFF"
answer = translate( SysGetKey( "NOECHO" ) )
call SysFileTree cdpbak, "exist.", "F", , "**---"
if answer = "R" then do
if exist.0 = 1 then address CMD "@CMD /C DEL "||cdpbak
address CMD "@CMD /C REN "||cdptxt||" *.BAK"
leave
end
if answer = "D" then do
address CMD "@CMD /C DEL "||cdptxt
leave
end
freq = freq * 2
if freq > 3000 then freq = 220
end
/* Write header */
call SysCls
string = "Text version of CDP.INI"
say string
call lineout cdptxt, ";"||string
string = date()||" "||time()
say string
call lineout cdptxt, ";"||string
call lineout cdptxt, ""
/* Lijst met CD's */
call SysIni cdpini, "ALL:", "cd."
if cdlist.0 > 0 then do i=1 to cd.0 by 1
call SysIni cdpini, cd.i, "ALL:", cd.i.
if cd.i.0 > 0 then do j=1 to cd.i.0 by 1
if cd.i.j = "IMMCDDiscTitle" then do
string = "["||translate( SysIni( cdpini, cd.i, cd.i.j ), "()", "[]" )||"]"
say "[4;1H"||string||"[K"
call lineout cdptxt, string
string = " Checksum = "||cd.i
say "[5;1H"||string||"[K"
call lineout cdptxt, string
string = " IMMCDDiscTitle = "||SysIni( cdpini, cd.i, cd.i.j )
say "[5;1H"||string||"[K"
call lineout cdptxt, string
end
end
if cd.i.0 > 0 then do j=1 to cd.i.0 by 1
if abbrev( cd.i.j, "IMMCDDisc" ) = 0 then do
string = " "||cd.i.j||" = "||translate( SysIni( cdpini, cd.i, cd.i.j ), "; ", "0D0A"X )
say "[5;1H"||string||"[K"
call lineout cdptxt, string
end
else do
if cd.i.j <> "IMMCDDiscTitle" then do
string = ' '||cd.i.j||' = "'||c2x( SysIni( cdpini, cd.i, cd.i.j ) )||'"X'
say "[5;1H"||string||"[K"
call lineout cdptxt, string
end
end
end
call lineout cdptxt, ""
end
call lineout cdptxt
page last modified: 2023-03-10