MacFORTRAN 3.2
Volume Number: 9>replyPtr Issue Number: 7>replyPtr$ Column Tag: Jörg's Folder>replyPtrb Absoft MacFORTRAN 3.2 >replyPtru 8An interface to match the quality of its code optimizer>replyPtr ABy Jörg Langowski, MacTech Magazine Regular Contributing AuthorÄ U Note: Source code files accompanying article are located on MacTech CD-ROM or>replyPtr source code disks.>replyPtr$LThose of you who have followed this column may have noticed that there are two>replyPtr Nmajor Fortran compilers for the Macintosh available: Absoft and Language Systems>replyPtrfl UFortran. And, for a long time, the main difference between the two products was that>replyPtrÎ SAbsoft offered better performance - for typical programs, the code executed of the>replyPtr˜ Oorder of 25-40% faster than Language Systems, depending on the program and on the>replyPtr Rmachine. Language Systems, on the other hand, had by far the superior Macintosh user>fixBtnName Iinterface, with easy assignment of subroutines to menu items, with Apple Events>replyPtr Rsupport and Publish/Subscribe possibilities. Absoft’s Macintosh support was only>fixBtnName' #very rudimentary compared to that.>replyPtr $PWell, some weeks ago I received an evaluation copy of MacFortran 3.2 by Absoft,>fixBtnName? Oand I must say that the situation has completely changed. Here is a version of>replyPtr UMacFortran that finally comes with a Macintosh interface that matches the undeniable>replyPtr Wquality of Absoft’s code optimizer It is like someone at Absoft has read my columns>replyPtr T(really! I’m flattered!) and incorporated each and every suggestion how to improve>fixBtnNameo Wtheir Macintosh support, and then some. Of course, the general quality of the compiler>replyPtr Zand the performance of the code generated has not changed. So in this column I’d like to>fixBtnName Hpresent you the main features of Absoft’s MRWE (MacFortran Runtime Window>fixBtnName >Environment), and show you an example program that uses them.>fixBtnName X&The MacFortran runtime window environment>fixBtnName $OAbsoft’s MRWE is a library of Fortran routines that is usually linked into an>replyPtr ? application, unless you decide to build an MPW tool or create your own application>replyPtr Qframework around an event loop. At first glance, the new MRWE offers about the same>replyPtr Jpossibilities as Language System’s runtime environment: one can associate a>fixBtnNameÍ Tsubroutine pointer to a menu item, and when the item is selected, the subroutine is>fixBtnNameˆ Vexecuted; one can use the standard file dialog for opening a file, by specifying an emptyapplication Ofilename string in the OPEN statement; the output window is a scrollable Text Edit>replyPtr N window, fonts and font sizes can be changed and the text saved to a file. An applicationapplication Lgenerated using MRWE will be Apple Event aware; you can easily add handlers for yourapplication& Qown Apple Events, and send those events out. You can also open a file and publish it to>replyPtr2 Aother applications that support the subscribe/publish mechanism of System 7.>replyPtr>$LBut Absoft has gone farther, and added features that the LS Fortran runtimeapplicationJ Upackage does not support (not yet - but we can be sure that they won’t be sleeping>replyPtrV Ueither. I am curious about their next upgrade). One very important new addition is>replyPtrb Qthe possibility to assign an input/output window to any Fortran file unit - thus you>replyPtrn Scan have multiple I/O windows, all scrollable and with custom font settings, and with>replyPtrz Jthe text saved to a file. The way to do this is simply to use OPEN (unit,application NACCESS=’ window’, ), and the window title will be the filename given in the
Mstatement. Up to 32 windows can be opened simultaneously this way, which gives you>replyPtr 'ample opportunity to confuse the user.>replyPtr $GThe OPEN statement is also used for implementing the publish/subscribe>replyPtr Tsupport. For creating a new edition of a file (which other programs can then subscribeapplication Uto), you open the file by OPEN (unit, ACTION=’publish’, ); on the other hand, by>replyPtr Rusing OPEN (unit, ACTION= ’subscribe’, ) you may read an edition generated byapplication Ranother program. In both cases, the files will be sequential and typically text files.applicationÊ$SFinally, in the OPEN statement one can also define the filetype and creat