- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for another stupid question, but I am using FORTRAN-Winprint to print to my windows printer and I've got it working. I wanted to got to the top of a new page after a write statement and for the life of me I can't remember how to do it.
In the old days with carriage control a 1 in column 1 would do the trick but I am at a loss to remember how to do it. I posted below a piece of my old FORTRAN code that designs base plates and I wanted to start a new page for the next bolt in my do loop.
C WRITE(*,236)
WRITE(2,236)
236 FORMAT(2X,'BOLT',/2X,'NUMBER',3X,'X COORD',3X,'Y COORD',5X,'LOAD'
+ ,5X,'RADIAL DIST',5X,'ANGLE FROM X AXIS'/)
DO 260 I=1,ITOT
C WRITE(*,237)I,POS(1,I),POS(2,I),BLOAD(I),DIS(I),RTD(ANGLE(I))
260 WRITE(2,237)I,POS(1,I),POS(2,I),BLOAD(I),DIS(I),RTD(ANGLE(I))
237 FORMAT(5X,I3,1X,F9.3,1X,F9.3,1X,F8.3,9X,F7.4,9X,F8.4)
write (2,707)
707 Format('1' 10x 'Start new plate solution'/)
C
926 CONTINUE
999 CONTINUE
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the file is opened with CARRIAGECONTROL='FORTRAN', then indeed the first column is used for carriage control and a 1 there will start a new page. You can read this in the code for Fortran_WinPrint. Probably your file is not opened with that option.
You could add whatever you wanted to trigger this, say a FF character in column 1. It's very clear in the source how this is done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to get the top of page to be selected but I had to edit the code in FORTRAN_winprint to change the parameter DFortran_CC to TRUE
logical(4), parameter :: DFortran_CC = .FALSE. ! Fortran carriage control?
logical(4) :: WFortran_CC
I tried to put your suggestion into the Open statement but it did not work:
open (unit=1,file=OUTFILE,form='formatted',
1 status='old',action='read',
2 CARRIAGECONTROL='FORTRAN')
istat = Print_Unit (1, Default_Printer=.FALSE.)
close (1)
I'm not sure where CARRIAGECONTROL='FORTRAN' goes in my .FOR program but changing the DFortran_CC to TRUE worked for me.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page