!Generate a QuickWin app with access to a console window.
!Compile:
! f90 confunc.f90 /dll !generate confunc.lib, confunc.dll
! f90 /libs:qwin conapp.f90 confunc.lib 

!This program, along with confunc.f90, shows how to allocate
!a console and do IO to it in a QuickWin program.  Since the
!console is text only, it can hold many more lines than a
!QuickWin window which must hold graphics as well as text.
!See the comments in confunc.f90 for a more detailed explanation.

program qwconapp
use ConFunc
integer i,istat
logical lstat
character*80 line

write(*,*) "This output goes to a QuickWin window."

lstat = GetCon(1000,100)

write(*,*) lstat

do i = 1, 900
istat = WriteConsoleLine("This output goes to the Console window.",i)
enddo

istat = WriteConsoleLine("Please enter a non blank line to finish.",i)

istat = ReadConsoleLine(line) ! this will come from the Console window

write(*,*) "From console window >", LINE

lstat = FreeCon()

write(*,*) lstat

end
