Specifications

DDE reference
194
Glink: API reference manual Gallagher & Robertson
worktext.LinkItem = "Script"
worktext.Text = cmdialog1.Filename
worktext.LinkMode = 1
worktext.LinkPoke
End Sub
Sub recvstuff_Change ()
' This subroutine is called each time new data arrives from the
' host. The textbox recvstuff is hot-linked to Glink via LinProc.
Static okdone%
If okdone% = -1 Then
MsgBox "oops!" + recvstuff.Text
Exit Sub
End If
okdone% = -1 ' do not allow reentry while looking at dde
xcn$ = viewhost.Text
recvlen% = Len(recvstuff.Text)
For i% = 1 To Len(recvstuff.Text)
ch$ = Mid$(recvstuff.Text, i%, 1)
If ch$ = Chr$(10) Then ' linefeed
' force new line in our display textbox
xcn$ = xcn$ + Chr$(13) + Chr$(10)
lvideo% = InStr(1, vidyline$, " VIDEO- ")
If lvideo% > 0 Then
v$ = Mid$(vidyline$, lvideo%)
'vidyline$ = v$
sname.Caption = Mid$(v$, 10, 6)
sproc.Caption = Mid$(v$, 22, 1)
sysproc% = Val(sproc.Caption)
smemk.Caption = Mid$(v$, 31, 7)
sysmemk& = Val(smemk.Caption)
vidylnum% = 1
Else
vidylnum% = vidylnum% + 1
If Mid$(vidyline$, 19, 8) = " IDLE- " Then
imemk.Caption = Mid$(vidyline$, 29, 6)
icp.Caption = Mid$(vidyline$, 36, 3)
End If
End If
vidyline$ = ""
ElseIf ch$ = Chr$(13) Then ' carriage return
' xcn$ = xcn$ + ch$ ' "\015" + Chr$(13)
ElseIf ch$ >= " " And ch$ < Chr$(127) Then
xcn$ = xcn$ + ch$
vidyline$ = vidyline$ + ch$
ElseIf ch$ <> Chr$(127) Then
xcn$ = xcn$ + "\" + Oct$(Asc(ch$)) + "&"
End If
Next i%
If Mid$(vidyline$, 19, 8) = " GCOS- " Then
gmemk.Caption = Mid$(vidyline$, 29, 6)
gcp.Caption = Mid$(vidyline$, 36, 3)
End If
'viewhost.text = xcn$ + "<" + Str$(recvlen%) + ">"
okdone% = 0
End Sub
Sub sendbutton_Click ()
' Come here when the commandbutton named sendbutton is pressed on
' then main form. This uses the DDE LinXmt LinkPoke function
' to send the text in the textbox sendstuff to the host.
viewhost.Text = ""
sendstuff.LinkTopic = "GL|GLINK"
sendstuff.LinkItem = "LinXmt"
sendstuff.LinkMode = COLD
sendstuff.LinkPoke
sendstuff.Text = "" ' clear the input