NB. client
NB.
NB. This is an example of a client for a J DDE server using script:
NB.    system\packages\dde\server1.ijs
NB.
NB. Method: first load another copy of J, and run the server1 script.
NB.         (you can set up an icon/shortcut to do this)
NB.         then run this script. Use cmd to send commands.
NB.
NB. Use cmd to send commands, for example:
NB.    cmd 'i.2 3 4'
NB.    cmd '+/\i.10'
NB.
NB. to signoff:
NB.    cmd 'off'

NB. event handler for dde advise:
sys_ddeadvise=: 3 : 0
j=. (-2*CRLF-:_2{.sysdata) }. sysdata
j 1!:2[2
)

cmd=: 3 : 0
wd 'ddepoke jserver top item *',":y.
)

NB. initiate conversation:
3 : 0''
if. -. 1 e. 'jserver top' E. wd 'ddecons'
do. wde 'ddestart jserver top item' end.
empty''
)
