Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

help with internal write

kkajino
Beginner
730 Views
program test
integer Num
character NumTex*6
Num=123450
!write(UNIT=numtex,fmt=('a6')) num
!write(UNIT=numtex,fmt=('i6')) num
write(UNIT=numtex,fmt=*) num
write(*,*) numtex
end
After reading the manual on internal writes, I wrote the above test program to try it, but, one of the above internal write statements work.
When I use fmt=*, I get the error, "output statement overflow record, unit -5, file internal list-directed write".
When I use fmt=('a6'), I get a syntax error on the formatting during runtime.
Could anyone point out what I'm doing wrong?
I'm using compaq visual fortran v6.6 on windows XP.
Thanks,
Kent
0 Kudos
2 Replies
pjrichar
Beginner
730 Views
Try
program test
integer Num
character NumTex*6
Num=123450
write(numtex,'(a6)') num
write(numtex,'(i6)') num
stop
end
0 Kudos
kkajino
Beginner
730 Views
Thanks for the help.
'(i6)' gave me the correct result. '(a6)' gave me a smiley-face. : )
0 Kudos
Reply