Local subroutines

And finally we define the local routines used in the main body. @d Local procedures for MakeTeXFont.rexx @BREAK_C: BREAK_D: Call Log "Execution aborted!"

If Exists(CURGFFILENAME) Then Delete CURGFFILENAME If Exists(CURLOGFILENAME) Then Delete CURLOGFILENAME

Exit 10 @| BREAK_C BREAK_D @

Log-function @d Local procedures for MakeTeXFont.rexx @Log: Procedure Expose MASTERLOG FONTNAME MODE HBASE VBASE DPI MAG Parse Arg MSG

MESSAGE = Date() Time() || ":" MESSAGE = MESSAGE FONTNAME "for" MODE MESSAGE = MESSAGE "("HBASE","VBASE") with" DPI "dpi" MESSAGE = MESSAGE "(mag="MAG")" '0A'X MESSAGE = MESSAGE || MSG Say MESSAGE

If Open(LOGFILE,MASTERLOG,'Append') Then Do Say "Can't open logfile!" Return End

DUMMY = WriteLn(LOGFILE,MESSAGE) If Close(LOGFILE) Then Say "Can't close logfile!"

Return @| Log @

@d Local procedures for MakeTeXFont.rexx @Error: Say "Translation problem, MetaFont returned "ERRORCODE"." Call Log("Translation problem, MetaFont returned "ERRORCODE".") Return @| Error @

When will ARexx supply `GetEnv/SetEnv'? @d Local procedures for MakeTeXFont.rexx @MyGetEnv: Procedure Parse Arg NAME

If Open(TEMPFILE,"ENV:"||NAME,'READ') Then Do GIVES = Readln(TEMPFILE) Call Close TEMPFILE End; Else GIVES = ""

Return GIVES @| MyGetEnv GIVES TEMPFILE @

Create a subdirectory. @d Local procedures for MakeTeXFont.rexx @SafeMakeDir: Procedure Parse Arg DIRNAME

If Exists(DIRNAME) Then Do MakeDir DIRNAME If Exists(DIRNAME) Then Do Call Log("Could not create directory" DIRNAME) Exit 10 End Say "Directory ("DIRNAME") did not exist. It was created." End

Return @| SafeMakeDir DIRNAME @

Create a file. @d Local procedures for MakeTeXFont.rexx @SafeMakeFile: Procedure Parse Arg FILENAME

If Exists(FILENAME) Then Do "echo >" || FILENAME If Exists(FILENAME) Then Do Call Log("Could not create file="FILENAME) Exit 10 End Say "File ("FILENAME") did not exist. It was created." End

Return @| SafeMakeFile FILENAME @