Thanks for the suggestions. I've noted the word of caution about equivalence but as the following shows it does appear to work. (Actually I've never used equivalence before in 30 years dabbling in Fortran).
Just need to fix the sign of j when the imaginary part is negative +j-0.5 looks a bit clumsy (and is misleading).
module test
implicit none
complex(kind = 2) a_c, b_c, c_c
real(kind = 2) a(2), b(2), c(2)
equivalence (a_c, a)
equivalence (b_c, b)
equivalence (c_c, c)
contains
integer function init()
complex(kind = 2) j
j = cmplx(0.d0,1.d0)
a_c = 0.5d0 - j*0.5d0
b_c = 0.5d0 - j*0.5d0
c_c = a_c*b_c
init = 1
end function init
integer function c_m()
include<windows.ins>
c_c = a_c * b_c
c_m = 1
end function c_m
integer function window()
include <windows.ins>
integer i
i = winio@('%cn%ws&','Multiply two complex numbers')
i = winio@('%2nl&')
i = winio@('%cn%8.1ob&')
i = winio@('%bg&',rgb@(250,250,250))
i = winio@('%^rf&',a(1),c_m)
i = winio@('%cb&')
i = winio@('%ws&','+j')
i = winio@('%^rf&',a(2),c_m)
i = winio@('%cb&')
i = winio@('%ws&','x')
i = winio@('%cb&')
i = winio@('%^rf&',b(1),c_m)
i = winio@('%cb&')
i = winio@('%ws&','+j')
i = winio@('%^rf&',b(2),c_m)
i = winio@('%cb&')
i = winio@('%ws&','=')
i = winio@('%cb&')
i = winio@('%`rf&',c(1))
i = winio@('%cb&')
i = winio@('%ws&','+j')
i = winio@('%`rf&',c(2))
i = winio@('%cb')
window = 1
end function window
end module test
program main
use test
implicit none
integer i
i = init()
i = window()
end program main