On Monday, February 10, 2020 at 1:51:23 PM UTC+11, sunnyboy010101 wrote:
[snip]
> Thanks Tony. I am using a STOP at the appropriate place.
>
> I have one more question that I feel I should know or be able to find out, but it's got me stumped.
>
> If I use LUN 3 (console), then linefeeds show up in my output without problem.
>
> (i.e.
>
> write(3,100)
> 100 format(1h ,'line1',//,'line2')
>
> BUT - if I use LUN 10 as in my previous posts and use CALL OPEN to send it to a file, the output is all on one line - basically the '//' is ignored.
>
> I know it's because LUN 10 is not considered a 'printer' (or other formatted output stream) but I can't figure out (nor can I find) a way to make it one, so that the '//' is again honored.
>
> -R
Formatted I/O in FORTRAN-80 requires an explicit line-feed character to be
output if you need it in a file. I think line-feed characters are ignored
on input (and you don't have to type them when you enter a line from the
console).
Tony
A>F80 T,TTY:/N=T
A:F80 COM
FORTRAN-80 Ver. 3.44 Copyright 1978-1981 (C) By Microsoft -- Bytes: 33350
Created: 10-Dec-81
1 program test
2 integer*1 lf
3 lf = x'0a'
4 call open(10,'T DAT',0)
5 write (10,5010) lf
6 5010 format(1X,'First line',/,A1,1X,'Second line')
7 endfile 10
8 stop
9 end
Program Unit Length=0049 (73) Bytes
Data Area Length=0034 (52) Bytes
Subroutines Referenced:
$I2 $INIT OPEN
$W2 $ND $EN
$ST
Variables:
LF 0001" H:0001 0002"
Labels:
$$L 0006' 5010L 000D"
A>L80 T/E,A:FORLIB/S,T/N
A:L80 COM
Link-80 3.44 09-Dec-81 Copyright (c) 1981 Microsoft
Data 0103 1ACD < 6602>
FORLIB RQUEST
43419 Bytes Free
[0137 1ACD 26]
A>t
A:T COM
STOP
A>dump t.dat
A:DUMP COM
CP/M 3 DUMP - Version 3.0
0000: 20 46 69 72 73 74 20 6C 69 6E 65 0D 0A 20 53 65 First line.. Se
0010: 63 6F 6E 64 20 6C 69 6E 65 0D 1A 00 00 00 00 00 cond line.......
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
A>