home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 105 / ac105a.adf / DASmodplayer.lzx / DASModPlayer / Rexx / MakeListAll2.drx < prev    next >
Encoding:
Text File  |  1995-02-22  |  2.9 KB  |  129 lines

  1. /*
  2.  
  3.    Make Module List, D.A.S ModulePlayer REXX-script for making modulelists!
  4.  
  5.     V0.01   Based on makelist.drx. Will print everything (except realname)
  6.  
  7.     If you want something removed or something in different order, then
  8.     you can either change it here or take examples from other makelist.drx
  9.     scripts.
  10.  
  11. */
  12.  
  13. OPTIONS Results
  14. ADDRESS 'DASMP'
  15.  
  16. signal on error
  17. signal on syntax
  18. signal on ioerr
  19. signal on break_c
  20. signal on break_d
  21.  
  22. unknownauthor = 'Unknown'
  23.  
  24. indexwidth = 4
  25. namewidth = 28
  26. authorwidth = 25
  27. stylewidth = 20
  28. timewidth = 6
  29. datewidth = 9
  30. sizewidth = 7
  31. chanwidth = 2
  32. typewidth = 5
  33. MODCOUNT
  34. modcounter=result
  35.  
  36. say ''
  37. say 'Make List All for D.A.S Moduleplayer, V0.01 by Pauli Porkka'
  38. say 'You have 'modcounter' modules in your list currently loaded to D.A.S'
  39. call writech(stdout, 'Do you want to list them all (Y/N)? ')
  40. answer = readln(stdin)
  41. answer = upper(answer)
  42. if answer='Y' then do
  43.    startlist = 0
  44.    endlist = modcounter - 1 
  45.    END
  46. else DO
  47.    call writech(stdout, 'Enter starting position (0-'modcounter')? ')
  48.    startlist = readln(stdin)
  49.    call writech(stdout, 'Enter ending position ('startlist+1'-'modcounter')? ')
  50.    endlist = readln(stdin)
  51.    END
  52.  
  53. say ''
  54.  
  55. listmode = 'ALL'
  56.  
  57. call writech(stdout, 'List to File or Screen (F/S)? ')
  58. answer = readln(stdin)
  59. answer = upper(answer)
  60. if answer='F' then DO
  61.    listfile='YES'
  62.    call writech(stdout, 'Enter pathfilename for the list? ')
  63.    listfilename = readln(stdin)
  64.    END
  65. else
  66.    listfile='NO'
  67.  
  68. listheader1 = left("Num", indexwidth)' 'left("Module name", namewidth)' 'left("CH", chanwidth)' 'left("Type", typewidth)' 'left("Style", stylewidth)' 'left("Length", timewidth)' 'left("Size", sizewidth)
  69. listheader2 = '-----------------------------------------------------------------------------------------------'
  70.  
  71. if listfile='YES' then DO
  72.    call open(listfilehandle, listfilename, 'W')
  73.    call writeln(listfilehandle, listheader1)
  74.    call writeln(listfilehandle, listheader2)
  75.    END
  76. else DO
  77.    say listheader1
  78.    say listheader2
  79.    END
  80.    modulecount=0
  81. DO modspec= startlist to endlist
  82.  
  83.    MOVETO modspec
  84.    GETAUTHOR
  85.    authorspec=result
  86.    printline=0
  87.  
  88.       modulecount=modulecount+1
  89.       MODNAME
  90.       namespec=result
  91.       GETSTYLE
  92.       stylespec=result
  93.       stylespec=strip(stylespec,L,'-')
  94.       GETTIME
  95.       timespec=result
  96.       GETSIZE
  97.       sizespec=result
  98.       GETTYPE
  99.       typespec=result
  100.       GETCHANS
  101.       chanspec=result
  102.       moduleline = left(modulecount, indexwidth)' 'left(namespec, namewidth)' 'left(chanspec, chanwidth)' 'left(typespec, typewidth)' 'left(stylespec, stylewidth)' 'left(timespec, timewidth)' 'right(sizespec, sizewidth)
  103.  
  104.       if listfile='NO' then DO
  105.          say moduleline
  106.          END
  107.       else
  108.          call writeln(listfilehandle, moduleline)   
  109. END 
  110.  
  111. if listfile='YES' then
  112.    call close(listfilehandle)
  113.  
  114. EXIT
  115.  
  116. error:
  117. syntax:
  118. say 'Error at line 'sigl' in MakeListAll V0.1'
  119. EXIT
  120.  
  121. break_c:
  122. break_d:
  123. say 'Received a BREAK signal, aborted...'
  124. EXIT
  125.  
  126. ioerr:
  127. say 'I/O Error at line 'sigl
  128. EXIT
  129.