This example displays a message box if the name Joe is entered in response to a prompt when Reflection is transmitting characters one at a time to a host.

Option Explicit

Dim transmittedText As String 'Accumulated text


Private Sub Session_AfterTransmitString(ByVal TheString As String)


 'Check to see if user pressed Enter

 If TheString = Chr$(rcCR) Then

  'Display a message box if user typed "joe" on this line

  If UCase$(transmittedText) = "JOE" Then

   MsgBox "Hello Joe!"

  End If

  'Reset transmittedText to an empty string

  transmittedText = ""


 'If the user hasn't pressed Enter, add the transmitted

 'character to the transmittedText variable.


  transmittedText = transmittedText & TheString

 End If


End Sub