home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************/
- /* ClassX Amiga Rexx script - Copyright © 1997 ClassX Development */
- /******************************************************************/
-
- /*
- $VER: ShowProjects.rexx 3.0
- */
-
- /*
- #ITA "Mostra i Progetti"
- #INF "Mostra tutti i progetti della directory 'FontMachine:Projects'."
- #INF "- Descrizione:"
- #INF " La macro esegue una scansione della directory 'FontMachine:Projects'"
- #INF " cercando e visualizzando i progetti di FontMachine."
- #INF "- Uso:"
- #INF " Dopo il caricamento di ogni progetto, FontMachine apre un requester"
- #INF " mostrando il nome del file relativo. A questo punto, cliccando 'Ok'"
- #INF " si continua la scansione. 'Stop' blocca l'esecuzione dello script."
- #END
- */
-
- /*
- #ENG "Show Projects"
- #INF "Shows all the projects in the 'FontMachine:projects' dir."
- #INF "- Description:"
- #INF " The macro scans the 'FontMachine:Projects' searching for suitable"
- #INF " FontMachine projects to show."
- #INF "- Usage:"
- #INF " For each project, FontMachine opens a requester showing the name."
- #INF " Now it's possible to stop the script with the 'Stop' button, or"
- #INF " proceed to the next project clicking 'Ok'."
- #END
- */
-
-
- MYPORT = 'FontMachine'
-
- IF ~SHOW('P', MYPORT) THEN DO
- IF EXISTS('FontMachine:FontMachine') THEN DO
- ADDRESS COMMAND 'Run >NIL: FontMachine:FontMachine'
- DO 30 WHILE ~SHOW('P',MYPORT)
- ADDRESS COMMAND 'Wait >NIL: 1 SEC'
- END
- END
- ELSE DO
- SAY "FontMachine could not be loaded."
- EXIT 10
- END
- END
-
- IF ~SHOW('P', MYPORT) THEN DO
- SAY 'FontMachine Rexx port could not be opened.'
- EXIT 10
- END
-
- ADDRESS VALUE MYPORT
- OPTIONS RESULTS
- OPTIONS FAILAT 10000
-
- /* Make sure rexxsupport library is opened */
- IF ~SHOW('L','rexxsupport.library') THEN CALL ADDLIB('rexxsupport.library',0,-30)
-
- SIGNAL ON Break_C
- SIGNAL ON Break_D
-
- /******************************************************************/
-
- LockGui
-
- /* set relevant paths for projects and temp files */
- PrjDir = 'FontMachine:Project/'
-
- /* scan the projects dir */
- Files = SHOWDIR(PrjDir,'f',"|")
- fLength = LENGTH(Files)
-
- nList=0
- DO WHILE fLength>0
- cLength=pos('|',Files)
- IF cLength=0 THEN DO
- cLength=FLength+1
- fLength=0
- END
- cFile = LEFT(Files,cLength-1)
- pFile = PrjDir||cFile
-
- /* load the project */
- FreeFont
- FreeTexture Front
- FreeTexture Border
- LoadProject pFile
-
- IF RC=0 THEN DO
- CALL WaitRender
- Request '"FontMachine"' '"Project: '||cFile||'"' 'Ok|Stop'
- END
- ELSE Request '"FontMachine"' '"'FM_ERROR'"' 'Ok'
-
- /* check if user has stopped the script */
- IF FM_RESULT=0 THEN FLength = 0
-
- /* next project */
- if FLength~=0 then Files=right(Files,fLength-cLength)
- fLength=fLength-cLength
- end
-
- Request '"FontMachine"' '"End"' 'Ok'
-
- UnLockGui
-
- /******************************************************************/
-
- WaitRender: PROCEDURE
- /* wait the rendering of the font */
- DO FOREVER
- CheckRedraw
- if FM_RESULT ~= 0 then ADDRESS COMMAND 'Wait >NIL: 1 SEC'
- else LEAVE
- END
- RETURN
-
- /******************************************************************/
-
- /* break handlers */
- Break_C:
- Break_D:
- UnLockGui
- Request '"FontMachine"' '"Procedure Stopped"' 'Ok'
- RETURN
-
- /******************************************************************/
-