home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / musicmaniii_inst / data / arexx / exporthtml.mmx next >
Text File  |  1997-08-25  |  3KB  |  97 lines

  1. /*
  2.  * ExportHTML.mmx
  3.  *
  4.  *
  5.  * ©1997 Andreas Mair
  6.  *
  7.  *
  8.  * Version:      1.00
  9.  * Date:         19.07.1997
  10.  *
  11.  * Function:     A simple ARexx-Script for use with MusicManIII.
  12.  *               This script will read all records of the currently open file
  13.  *               in MusicManIII and write it to an HTML-file.
  14.  *
  15.  *               The output consists of three HTML-files:
  16.  *
  17.  *                - index.htm      open this file in your WWW-browser
  18.  *                                 (must support tables and frames!)
  19.  *
  20.  *                - contents.htm   this file is displayed in the left frame
  21.  *                                 it shows alphapetic links to let you jump
  22.  *                                 quickly to those records
  23.  *
  24.  *                - data.htm       this file is displayed in the right frame
  25.  *                                 this file contains the records' data in the format:
  26.  *
  27.  *                                   Artist
  28.  *                                   Title
  29.  *                                   Songs Length (for every song)
  30.  *                                   separator
  31.  *
  32.  *               NOTE: * this script will always overwrite the files "contents.htm"
  33.  *                       and "data.htm", so you have to rename the files if you want
  34.  *                       to keep them.
  35.  *                     * the file "index.htm" is never created! Don't loose it ;-)
  36.  *
  37.  * Requirements: MusicManIII V3.06 (or above)
  38.  *               ARexx running
  39.  *
  40.  * Usage:        - first start MusicManIII and load the file you want to export
  41.  *               - go to a CLI (or Shell) and start this script ("rx ExportHTML.mmx")
  42.  *
  43.  */
  44.  
  45. ADDRESS 'MUSICMAN'
  46.  
  47. OPTIONS RESULTS
  48.  
  49. QUERY RECORDSCOUNT
  50. MaxRecords=RESULT
  51.  
  52. RECORD GET NUMBER 1
  53.  
  54. CALL OPEN( "cont", "contents.htm", 'WRITE' )
  55. CALL OPEN( "data", "data.htm", 'WRITE' )
  56.  
  57. CALL WRITELN( "data", "<HTML>" )
  58. CALL WRITELN( "cont", "<HTML>" )
  59.  
  60. LastChar=' '
  61.  
  62. DO i=1 TO MaxRecords
  63.     SAY "Working on record #"i" of "MaxRecords
  64.  
  65.     QUERY ARTIST TITLE SONGSCOUNT SUBRECORDSCOUNT STEM record.
  66.  
  67.     IF LEFT( record.artist, 1 )~=LastChar THEN
  68.         DO
  69.         LastChar=LEFT( record.artist, 1 )
  70.         CALL WRITELN( "cont", '<A HREF="data.htm#'LastChar'" TARGET="data">'LastChar'</A><BR>' )
  71.         CALL WRITELN( "data", '<A NAME="'LastChar'">' )
  72.         END
  73.  
  74.     CALL WRITELN( "data", "<HR><H1>"record.artist"<BR>"record.title"</H1><BR>" )
  75.  
  76.     CALL WRITELN( "data", "<TABLE NOBORDER CELLPADDING=5>" )
  77.  
  78.     DO j=1 TO record.songscount
  79.         QUERY SONG LENGTH BPM SPECIAL STEM song.
  80.         CALL WRITELN( "data", "<TR><TD>"j"</TD><TD>"song.song"</TD><TD>"song.length"</TD></TR>" )
  81.         SONG NEXT
  82.     END
  83.  
  84.     CALL WRITELN( "data", "</TABLE><P>" )
  85.  
  86.     RECORD NEXT
  87.  
  88.     CALL WRITELN( "data", "")
  89. END
  90.  
  91. CALL WRITELN( "cont", "</HTML>" )
  92. CALL WRITELN( "data", "</HTML>" )
  93.  
  94. CALL CLOSE( "cont" )
  95. CALL CLOSE( "data" )
  96.  
  97.