The following program tries to create a drop-down list, but not all the listed items are printed correctly. The correct list is printed first, together with the number of items, and then the drop-down list is invoked. If the code in subroutine s1 is moved to the main program then the list seems to be ok.
Winapp
Program p
Use clrwin, Only: winio@
Integer, Parameter :: lc = 32, n = 10
Integer :: i, iw
Character(Len=lc), Dimension(n) :: t1
iw = winio@('%ca@&', 'List')
Call s1 ()
iw = winio@('')
Stop
Contains
Subroutine s1 ()
Do i = 1, n
Write (Unit=t1(i), Fmt='(I4)') 2000 + i
iw = winio@('%ws%nl&', t1(i))
End Do
i = 1
iw = winio@('%wd%nl%nl&', n)
iw = winio@('%`15ls%ff&', t1(:), n, i)
Return
End Subroutine s1
End Program p