Xref: utzoo comp.lang.fortran:5769 comp.sys.ibm.pc:55462 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!lee From: lee@ohstpy.mps.ohio-state.edu Newsgroups: comp.lang.fortran,comp.sys.ibm.pc Subject: Help: MS-DOS FORTRAN Message-ID: <10328.286746c7@ohstpy.mps.ohio-state.edu> Date: 25 Jun 91 17:36:07 GMT Lines: 102 Hello, folks! I need help from Fortran experts. Recently, I got MS-DOS FORTRAN V5.1(V5.0?) for IBM-PC without any manual, so I have to figure out how I can run a program originally used for VAX FORTRAN. The Following program is just a test program that contains all the informations that I want to know their corresponding statements or intrinsic functions. Any suggestions or partial answers will be greatly appreciated. Please send messages to my e-mail address or post your comments. Thank you in advance. Ki Ho Lee (bitnet) LEE@OHSTPY (internet) LEE@OHSTPY.MPS.OHIO-STATE.EDU (internet) LEE@PACIFIC.MPS.OHIO-STATE.EDU C CC ---------- BEGINNIG OF PROGRAM TEST -------------------------- C PROGRAM TEST CHARACTER*1 ANS CHARACTER*10 CDATE,CTIME,SSS CHARACTER*20 CDATIM C C (Question #1) Do OPEN, CLOSE, REWIND work in MS-DOS Fortran ? C OPEN(UNIT=9,FILE='TEST.OUT',STATUS='NEW') WRITE(6,*) 'Open statement works!' WRITE(9,*) 'Open statement works!' CLOSE(9) WRITE(6,*) WRITE(6,'('' Hit '',$)') READ(5,'(A1)') ANS C C (Question #2) How can I clean the screen ? C WRITE(6,*) CHAR(27),'[1;1f',CHAR(27),'[J' WRITE(6,*) ' *** THE FIRST LINE OF THE SCREEN **********' WRITE(6,*) ' *** THE SECOND LINE *********************' WRITE(6,*) ' *** THE THIRD LINE *********************' WRITE(6,*) ' *******************************************' WRITE(6,*) CHAR(27),'[10;75f',CHAR(27),'[J' WRITE(6,*) ' *** THE 10th LINE **********' WRITE(6,*) WRITE(6,'('' Hit '',$)') READ(5,'(A1)') ANS C C (Question #3) Is there any same function like SPAWN ? C WRITE(6,*) 'Rename an existing file to another name.' WRITE(6,*) 'Wait for a moment.' WRITE(6,*) CALL LIB$SPAWN('RENAME TEST.OUT TEST.DAT') WRITE(6,*) WRITE(6,'('' Hit '',$)') READ(5,'(A1)') ANS C C (Question #4) How can I exit to DOS for a moment without C terminating this program ? C WRITE(6,*) WRITE(6,*) 'Gate to "$$ " temporarily' WRITE(6,*) 'Use "LOGOUT" to return to the program.' WRITE(6,*) 'Wait for a moment.' WRITE(6,*) CALL LIB$SPAWN('SPAWN/PROMPT="$$ "/NOLOG ') C C (Question #5) How can I get today's date and current time ? C Are the format like 25-JUN-91 and 12:30:10 ? C CALL DATE(CDATE) CALL TIME(CTIME) WRITE(6,'('' Today is '',A10)') CDATE WRITE(6,'('' Current time is '',A10)') CTIME C C (Question #6) Is there the same intrinsic function INDEX ? C SSS='123$789' I=INDEX(SSS,'$') WRITE(6,*) WRITE(6,'(1X,A10,I10)') SSS,I C C (Question #7) How can I put together two character variables ? C CDATIM=CDATE//CTIME WRITE(6,'(1X,A20)') CDATIM WRITE(6,*) C STOP END C CC ---------- END OF PROGRAM TEST --------------------------------- C (Question #8) How can I compile and link the above program ? ( What are the commands for FORTRAN and LINK ? Is there any option to get a list file ? ) (Question *9) What is the maximum dimension of an array ? (I guess it depends on the size of RAM. I forgot the capacity of my machine. Let's assume that I have 1 Mbytes.) ---KHL