home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Index / Scripts / Hotlist.rexx < prev    next >
OS/2 REXX Batch file  |  1995-09-17  |  3KB  |  94 lines

  1. /*
  2.  * $VER: Hotlist 0.1 (16.9.95)
  3.  *       © by Andreas Horneffer
  4.  * Erstellen einer Hotlist fuer die MP3
  5.  */
  6.  
  7. /*ED*/
  8.  
  9. HOTLIST= 's:MP3Hotlist'
  10. TMP= 't:'||pragma('ID')
  11. TMPHL= TMP||'hl'
  12.  
  13. parse arg Sprache DatID Delete
  14. options results
  15.  
  16. HOTLIST= HOTLIST||"."||Sprache
  17.  
  18.  
  19. DatID=DatID||" "
  20. shell command ':C/pgrep >'||TMP  '"'||DatID||'"' ':Index/Guides/bricks/'||Sprache||'-guide-root'
  21.  
  22. j= lastpos("/",DatID)
  23. DatID2= substr(DatID,j+1)
  24.  
  25. call open(tmfile, TMP, "r")
  26. newline =readln(tmfile)
  27. call close(tmfile)
  28. newline = "@@"||left(DatID2,26)||'@{"del" SYSTEM "Execute MPCD_S:Index/Scripts/show_prg_hotlist '||Sprache||' '||DatID||' MPCD_S DEL"} '||newline
  29. if open( tmfile, TMPHL , "w") = 0 then do
  30.   say 'Dies sollte  nicht passieren!'
  31.   exit
  32. end
  33. else nop
  34.  
  35. if open( file, HOTLIST , "r") = 1 then do
  36.   do until eof(file)
  37.    line= readln(file)
  38.    if left(line,2)='@@' then do
  39.      if line~=newline then call writeln(tmfile,line)
  40.      else do
  41.        if delete~="DEL" then do
  42.          if Sprache="deutsch" then
  43.            address command ':C/AutoReq "-tEintrag schon vorhanden - entfernen?" "-pJa" "-nNein"'
  44.          else
  45.            address command ':C/AutoReq "-tEntry already there - remove?" "-pYes" "-nNo"'
  46.          if RC=0 then newline=""
  47.        end
  48.        else newline=""
  49.      end
  50.    end
  51.    else nop
  52.   end
  53.   if newline~="" then call writeln(tmfile,newline)
  54.   else nop
  55.   call close(file)
  56. end
  57. else call writeln(tmfile,newline)
  58.  
  59. call close(tmfile)
  60.  
  61. shell command 'sort FROM 'TMPHL' TO ' TMPHL||'.srt COLSTART=3' /*ED*/
  62.  
  63. if open( file, TMPHL , "w") = 0 then do
  64.   say 'Dies sollte nicht passieren!!'
  65.   exit
  66. end
  67. else nop
  68. call writeln(file,copies(' ',28)||"@database MP3" )
  69. call writeln(file,copies(' ',28)||"@node MAIN "||d2c(34)||"Meeting Pearls Hotlist"||d2c(34))
  70. call writeln(file,copies(' ',28)||"")
  71. call writeln(file,copies(' ',28)||"@{B}Meeting Pearls III Hotlist@{UB}")
  72. call writeln(file,copies(' ',28)||"")
  73. if Sprache="deutsch" then do
  74.   call writeln(file,copies(' ',28)||'@{"Hilfe        " LINK HELP} was sollen die ganzen Knöpfe?')
  75.   call writeln(file,copies(' ',28)||'@{"Konfigurieren" LINK CONFIG} Sie, wie sich dieses Dokument auf Knopfdruck verhalten soll.')
  76. end
  77. else do
  78.   call writeln(file,copies(' ',28)||'@{"Help     " LINK HELP} what are all these buttons for?')
  79.   call writeln(file,copies(' ',28)||'@{"Configure" LINK CONFIG} what this document shall do when you press a button.')
  80. end
  81. call writeln(file,copies(' ',28)||"")
  82. call close(file)
  83. shell command 'join ' TMPHL ' ' TMPHL||'.srt TO ' HOTLIST
  84.  
  85. if open( file, HOTLIST , "a") = 0 then do
  86.   say 'Dies sollte nicht passieren!!!'
  87.   exit
  88. end
  89. else nop
  90. call writeln(file,copies(' ',28)||"@endnode" )
  91. call close(file)
  92.  
  93. shell command "delete" TMPHL TMPHL||".srt" TMP
  94.