/*
 * REMOVE.CMD
 * version 1.0 (C) Christian Hennecke
 *
 * Remove theme entry from Icon Theme Manager themes.lst file.
 * Run from WarpIN.
 *
 */
CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs';
CALL SysLoadFuncs;
 
PARSE ARG file;
 
thisTheme = 'drwboard';
i = 1;
 
/* read configuration file */
 
rc = stream(file, 'C', 'OPEN READ'); 
do while lines(file)
  line.i = linein(file);
  if left(line.i, length(thisTheme)) \= thisTheme   /* only raise counter if other theme */
    then i = i + 1;                                 /* => drop line for this theme */
end
rc = stream(file, 'C', 'CLOSE'); 
 
/* delete and write back configuration file */
rc = SysFileDelete(file);
rc = stream(file, 'C', 'OPEN WRITE'); 
do j = 1 to i - 1
  rc = lineout(file, line.j);  
end
rc = stream(file, 'C', 'CLOSE'); 
 
