Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!rex!uflorida!math.ufl.edu!math.ufl.edu!wang From: wang@math.ufl.edu Newsgroups: comp.lang.fortran Subject: character function subprogram Message-ID: <1991Apr7.200854.25446@math.ufl.edu> Date: 7 Apr 91 20:08:54 GMT Sender: news@math.ufl.edu Reply-To: wang@math.ufl.edu Organization: Department of Mathematics, University of Florida Lines: 36 Can anyboby explain to me why the following FORTRAN character function subprogram works under VAX/VMS, but doesn't work under unix (SunOS 4.1.1, Sun Fortran 1.3)? CHARACTER*8 cursor,cls*4 cls = CHAR(27)//'[2J' i = 5 j = 35 PRINT *,cls,cursor(i,j),'I am here!' END CHARACTER FUNCTION cursor*8(row,col) CHARACTER*1 esc,c1*2,c2*2 INTEGER row,col esc = CHAR(27) WRITE(c1,'(i2.2)') row WRITE(c2,'(i2.2)') col cursor = esc//'['//c1//';'//c2//'H' RETURN END As you can see, this character function routine just returns the character string for a cursor's position on the screen according to its two arguments. The above program works just fine on VAX/VMS machines but crashes on UNIX machines (specifically, SunSparc workstations). The error messages I got when I ran it on a SunSparc workstation are listed below: iio: [-1] end of file lately: writing sequential formatted internal IO part of last string: | IOT trap Can you offer a sulotion to fix the problem? Thanks a lot in advance!