I'm trying to set the Matlab icon within a FORTRAN program by using some code that I got online but some time ago (i.e. I don't know which version of Matlab is supported). Problem is that it doesn't work, i.e. icon is plain untitled document. I'm using a PowerMac running Language Systems FORTRAN and MPW Pro. Does anybody know what's wrong?
function setmat(filename) c c Sets Macintosh file type and creator for a MATLAB MAT-file, c so the correct icon will get attached to it. MATLAB ignores c MAT-files that have not been set properly. c c Returns 0 if successful; -1 if not. c c Original version: c Language: Absoft MacFortran. c Charles R. Denham, MathWorks. c c Ported to Language Systems FORTRAN by s.herskovitz c implicit none c c Load the Toolbox definition files c character*(*) filename string*255 name integer*4 setmat integer*2 vref,err parameter (vref=0) record /FInfo/ myfinfo c setmat = -1 c name = trim( filename ) err = GetFInfo( name, vref, %ref(myfinfo) ) if (err = noErr) then myfinfo.fdType = 'MATW' myfinfo.fdCreator = 'MATL' err = SetFInfo( name, vref, myfinfo ) if (err = noErr) setmat = 0 end if c return end c