Specifications
DDE reference
Gallagher & Robertson Glink: API reference manual 193
vidyline$ = ""
vidylnum% = 0
jobmore% = 0
r1:
recvstuff.LinkTopic = "GL|GLINK"
recvstuff.LinkItem = "LinProc 5000" ' Allow up to 5000 characters
recvstuff.LinkMode = NONE ' from the host per event.
recvstuff.LinkMode = HOT
recvstuff.LinkRequest
Exit Sub
startit:
If Err = DDE_NO_APP Then
t% = Shell("\gl50e\gl.exe /DDE GLINK", 1)
zapp% = DoEvents()
GoTo r1
Else
MsgBox "Error starting DDE: " + Str$(Err) + Error$
Stop
End If
End Sub
Sub mnuclose_Click ()
' Come here when menu File/Exit is selected.
' This ends this application.
End
End Sub
Sub mnuConn_Click ()
' Come here when menu Glink/Connect is selected.
' This issues a connect via LinCon LinkPoke.
Const NONE = 0, HOT = 1, COLD = 2
worktext.LinkTopic = "GL|GLINK"
worktext.LinkItem = "LinCon"
worktext.LinkMode = NONE
worktext.LinkMode = COLD
worktext.Text = ""
worktext.LinkPoke
End Sub
Sub mnuHalt_Click ()
' Come here when menu Glink/Halt is selected.
' This terminates the Glink emulator by executing the Halt
' script function via LinkExecute.
On Error Resume Next
If worktext.LinkMode <> NONE Then
worktext.LinkExecute "HALT"
End If
End Sub
Sub mnurunscr_Click ()
' Come here when menu File/Run script is selected.
' This uses the common dialog facility to obtain the path of a
' Glink script to launch via the DDE Script LinkPoke.
cmdialog1.InitDir = "\"
cmdialog1.Filter = "Script file (*.scr)|*.scr"
cmdialog1.FilterIndex = 1
cmdialog1.CancelError = -1
On Error Resume Next
cmdialog1.Action = 1 ' open file
If Err <> 0 Then
If Err = 32755 Then Exit Sub ' cancel clicked
MsgBox "Open Error " + Str$(Err) + Error$
Exit Sub
End If
MsgBox "Opened " + cmdialog1.Filename, 64
Close
worktext.LinkMode = 0
worktext.LinkTopic = "GL|GLINK"