- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IVF 8.1 is not printing a line feed before a page feed in my text output file. I open the text output file using:
OPEN (
* UNIT = OULUN,
* FILE = OUPATH,
* ACTION = 'WRITE',
* ACCESS = 'SEQUENTIAL',
* STATUS = 'UNKNOWN',
* CARRIAGECONTROL = 'FORTRAN',
* BLOCKSIZE = 80,
* FORM = 'FORMATTED',
* IOSTAT = OPERR,
* ERR = 400
* )
Here is a bit dump of the text output file:
000110 20 20 20 4C 6F 63 61 74 69 6F 6E 3A 0D 0A 20 0D
Location:?? ?
000120 0A 4E 6F 77 20 50 72 6F 63 65 73 73 69 6E 67 20
?Now Processing
000130 49 6E 70 75 74 20 2E 2E 2E 0D 0C 43 48 45 4D 54
Input ...??CHEMT
The line before the page feed (code 0C) before the 'CHEMT' text on line 130 has a carriage return (code OD) but it does not have a line feed (code 0A). All other lines have a terminating carriage return / line feed.
What am I screwing up here or is this a feature ? This is causing major pains with my benchmark comparison program.
Thanks,
Lynn
OPEN (
* UNIT = OULUN,
* FILE = OUPATH,
* ACTION = 'WRITE',
* ACCESS = 'SEQUENTIAL',
* STATUS = 'UNKNOWN',
* CARRIAGECONTROL = 'FORTRAN',
* BLOCKSIZE = 80,
* FORM = 'FORMATTED',
* IOSTAT = OPERR,
* ERR = 400
* )
Here is a bit dump of the text output file:
000110 20 20 20 4C 6F 63 61 74 69 6F 6E 3A 0D 0A 20 0D
Location:?? ?
000120 0A 4E 6F 77 20 50 72 6F 63 65 73 73 69 6E 67 20
?Now Processing
000130 49 6E 70 75 74 20 2E 2E 2E 0D 0C 43 48 45 4D 54
Input ...??CHEMT
The line before the page feed (code 0C) before the 'CHEMT' text on line 130 has a carriage return (code OD) but it does not have a line feed (code 0A). All other lines have a terminating carriage return / line feed.
What am I screwing up here or is this a feature ? This is causing major pains with my benchmark comparison program.
Thanks,
Lynn
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
BTW, the reason why this is a problem is that if you use c function fgets to read the text output file, you will get two lines stuffed into the same line. This is because the line feed got skipped before the page feed. So, the text line preceding the page feed and the line of the page feed will be together. Neat ! ! ! Not !
Thanks,
Lynn
Thanks,
Lynn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please show the WRITE and FORMAT for the CHEMT line and the previous one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is happening for all page feed writes ! The following is just one piece of the code. You asked, so here you go !
........
call scrwri ('Now Processing Input ...')
........
void SCRWRI (char * p, unsigned length)
{
// msg must be bigger than ScreenBuffer in termin.inc (add 1 for NULL)
char msg [10001];
int i = 0;
int blanks = TRUE;
msg [length] = '';
// dont write trailing blanks
for (i = length - 1; i >= 0; i--)
{
if ( ! blanks || p != ' ')
{
msg = p ;
blanks = FALSE;
}
else
msg = '';
}
writeLineToScreen (msg);
}
.........
void writeLineToScreen (char *msg)
{
int len = strlen (msg);
if (ScreenOutputWindow)
{
char newMsg [256];
// add a carriage return and a line feed
sprintf (newMsg, "%s ", msg);
totalCharactersWrittenToScreen += strlen (newMsg);
// move the cursor to the bottom of the text
SendMessage (ScreenOutputWindow, EM_SETSEL, -1, -1);
// actually write the string to the screen
SendMessage (ScreenOutputWindow, EM_REPLACESEL, 0, (LPARAM) newMsg);
SetFocus (ScreenOutputWindow);
MessageLoop ();
}
else
{
printf ("%s ", msg);
fflush (stdout);
}
if (len <= 0)
{
msg = " ";
len = 1;
}
WRITELINETOOUTPUTFILE (msg, len);
}
.........
subroutine WriteLineToOutputFile (msg)
INCLUDE 'dii.inc'
character*(*) msg
include 'termin.inc'
write (oufile, 10001) msg
10001 format (' ', A)
return
end
.........
WRITE (OUFILE,1000) APPL(1).I , APPL(2).I ,
* VNAM(1).I , VERCOD(1).I ,
* VERCOD (2).I , IFILE(2).I ,IFILE(3).I
1000 FORMAT (1H1, 2A4, A1, ' VER ', 2A3,
* 'COPYRIGHT WINSIM INC. 1995-2004 ALL RIGHTS RESERVED ', A4, A3)
.........
Lynn
........
call scrwri ('Now Processing Input ...')
........
void SCRWRI (char * p, unsigned length)
{
// msg must be bigger than ScreenBuffer in termin.inc (add 1 for NULL)
char msg [10001];
int i = 0;
int blanks = TRUE;
msg [length] = '';
// dont write trailing blanks
for (i = length - 1; i >= 0; i--)
{
if ( ! blanks || p != ' ')
{
msg = p ;
blanks = FALSE;
}
else
msg = '';
}
writeLineToScreen (msg);
}
.........
void writeLineToScreen (char *msg)
{
int len = strlen (msg);
if (ScreenOutputWindow)
{
char newMsg [256];
// add a carriage return and a line feed
sprintf (newMsg, "%s ", msg);
totalCharactersWrittenToScreen += strlen (newMsg);
// move the cursor to the bottom of the text
SendMessage (ScreenOutputWindow, EM_SETSEL, -1, -1);
// actually write the string to the screen
SendMessage (ScreenOutputWindow, EM_REPLACESEL, 0, (LPARAM) newMsg);
SetFocus (ScreenOutputWindow);
MessageLoop ();
}
else
{
printf ("%s ", msg);
fflush (stdout);
}
if (len <= 0)
{
msg = " ";
len = 1;
}
WRITELINETOOUTPUTFILE (msg, len);
}
.........
subroutine WriteLineToOutputFile (msg)
INCLUDE 'dii.inc'
character*(*) msg
include 'termin.inc'
write (oufile, 10001) msg
10001 format (' ', A)
return
end
.........
WRITE (OUFILE,1000) APPL(1).I , APPL(2).I ,
* VNAM(1).I , VERCOD(1).I ,
* VERCOD (2).I , IFILE(2).I ,IFILE(3).I
1000 FORMAT (1H1, 2A4, A1, ' VER ', 2A3,
* 'COPYRIGHT WINSIM INC. 1995-2004 ALL RIGHTS RESERVED ', A4, A3)
.........
Lynn

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page