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

Simple graphics program crashes

WSinc
New Contributor I
632 Views

It won't even open Unit #1. It says "Cannot use Title with a non-window unit"

How would it know ahead of time which units are supposed to be Windows units?

Are some unit numbers reserved?

Not only that, but it appears to go into a total freeze-up.

This is a QuickWin project.

--------------------------------------------------------------------------

program

test1

character*40 fn,win

do iun=1,4

write(fn,103)iun

103

format("File",i2)

104

format("Window",i2)

write(win,104)iun

open(unit=iun,file=fn,Title=win)

write(i,101)iun

101

format("UNIT NO. ",i3)

enddo

pause

do iun=1,4

close(unit=iun)

end do

pause "exiting"

end

0 Kudos
1 Reply
Steven_L_Intel1
Employee
632 Views
Bill,

First, please use "reply" to your existing thread and don't keep starting new threads. Unfortunately, I cannot merge these.

What exactly is this program supposed to do? fn will be, for the first iteration, "File 1" which is not legal. It must be exactly "USER" and nothing else if you want to open a QuickWin window. If it is "USER" you may also specify a title.

Also, you write to unit "i" which is undefined.

Try this version:

program test1
use ifqwin
character*40 fn,win

do iun=1,4

104 format("Window",i2)
write(win,104)iun
open(unit=iun,file='user',title=win)
write(iun,101)iun
101 format("UNIT NO. ",i3)
enddo

end
0 Kudos
Reply