@Echo Off :: WebTab.btm Builds an index.htm from all the MOZART files in a directory. :: Started with what is now the routine ":DoIt", later fleshed out with bits :: from Mike Bessy's mkindex2.btm and its revision by J.B. Falconer. :: Michael Bednarek mb@tgm.com.au http://mbednarek.com/ - May 2002 :: Oct-2003: Refined "Recycle"; used description of subdirectory for TITLE, H1 :: Used backquotes (`) instead of symbolic escape (%=) :: Jan-2004: Added switch to Codepage 1252 - necessary under NT5.x :: Jan-2004: Added inclusion of counter HTML code :: Apr-2004: Utilised _codepage instead of %@WORD[-0,%@EXECSTR[CHCP]] *SetLocal *Unalias * ALIAS Recycle=`%@IF[%_CMDPROC EQ 4DOS,C:\More95\Recycle -f,*DEL /R /Q]` :: Obtain only the current directory name: Set sub=%@Word["\",-0,%@Full[.]] Pause %0: Building index.htm for %sub [Hit Enter] Iff Exist index.htm Then Pause Deleting index.htm to the Recycle Bin [Hit Enter] Recycle index.htm EndIff SET old_UC=%@OPTION[UnicodeOutput] OPTION //UnicodeOutput=No Echo >index.htm `` :: SET descr=%@Descript[..\%sub] %+ This didn't work for umlauts :: Translation ASCII to ANSI through the Clipboard only works under NT5.x when Codepage=1252 :: But this only seems to work if UnicodeOutput=No - See above SET old_CHCP=%_codepage CHCP 1252>NUL ECHO %@Descript[..\%sub] > CLIP: SET descr=%@Clip[0] Echo>>index.htm ``http://mbednarek.com/%[sub] (%descr)`` REM Include MOZART header Copy /Q index.htm+..\mz-hd.htm EchoS>>index.htm `

mbednarek.com/`%sub (%descr)`

` Text >>index.htm
EndText EchoS>>index.htm `

`%descr`

` CHCP %old_CHCP >NUL Text >>index.htm
(Numbers are file size)
Title (actual file name) Filedate
dd/mm/yy
ZIP MOZART Icon (189 bytes)
MOZART
Text MIDI PDF EndText Rem Total files/scores indexed Set t=0 Set s=0 :: Translation ASCII to ANSI through the Clipboard only works under NT5.x when Codepage=1252 SET old_CHCP=%_codepage CHCP 1252 >NUL :: Avoid piping. Problems with 4NT and TC32. Dir /b %@If[%sub==nozze .OR. %sub ==tpo,/on,/oi] *.mz >%Temp\Files.tmp For %n In (@%Temp\Files.tmp) Gosub DoIt CHCP %old_CHCP >NUL Echo>>index.htm `

`[%s scores and %t files indexed on %_Date at %_Time +1000 Echo>>index.htm `by 4NT!]` REM Include Counter HTML code Copy /Q index.htm+..\counter.htm Echo>>index.htm `` Echo %s scores and %t files indexed on %_Date at %_Time OPTION //UnicodeOutput=%old_UC Quit :: Note that /TR and /TD are optional and not used here :DoIt Set fn=%@Name[%@LFN[%n]] :: Description (may contain redirection symbols) SetDos /X-56 /P%=$ /E%=^ /C%=& Set des=%@Replace[>,`%`=>,%@Replace[<,`%`=<,%@Descript[%fn.mz]]] SetDos /X+6 :: Translate ASCII to ANSI - only works under NT5.x when Codepage=1252 (see above) Echo>CLIP: %des SetDos /X-6 Set des=%@Replace[>,`%`=>,%@Replace[<,`%`=<,%@Clip[0]]] SetDos /X+6 EchoS>>index.htm ``%des``%fn :: Filedate Echo>>index.htm ``%@Filedate[%fn.mz] :: ZIP Echo>>index.htm ``%@Comma[%@FileSize[%fn.zip]]`` :: MOZART Echo>>index.htm ``%@Comma[%@FileSize[%fn.mz]]`` :: Text Iff Exist %fn.txt Then Echo>>index.htm ``%@Comma[%@FileSize[%fn.txt]]`` Else Echo>>index.htm `none` Set t=%@Dec[%t] EndIff :: MIDI Echo>>index.htm ``%@Comma[%@FileSize[%fn.mid]]`` :: PDF Echo>>index.htm ``%@Comma[%@FileSize[%fn.pdf]]`` Set t=%@Eval[%t+5] Set s=%@Inc[%s] Return