home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / internet / inter / node.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-03-08  |  2.8 KB  |  92 lines

  1. VERSION 2.00
  2. Begin Form frmNode 
  3.    Caption         =   "SuperChat"
  4.    ClientHeight    =   2145
  5.    ClientLeft      =   435
  6.    ClientTop       =   2295
  7.    ClientWidth     =   7065
  8.    Height          =   2550
  9.    Icon            =   NODE.FRX:0000
  10.    Left            =   375
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   2145
  14.    ScaleWidth      =   7065
  15.    Top             =   1950
  16.    Visible         =   0   'False
  17.    Width           =   7185
  18.    Begin TextBox txtNode 
  19.       FontBold        =   0   'False
  20.       FontItalic      =   0   'False
  21.       FontName        =   "MS Sans Serif"
  22.       FontSize        =   9.75
  23.       FontStrikethru  =   0   'False
  24.       FontUnderline   =   0   'False
  25.       Height          =   1485
  26.       Left            =   0
  27.       MultiLine       =   -1  'True
  28.       ScrollBars      =   2  'Vertical
  29.       TabIndex        =   0
  30.       Top             =   0
  31.       Width           =   7095
  32.    End
  33.    Begin dsSocket dssNode 
  34.       DataSize        =   2048
  35.       Left            =   120
  36.       Linger          =   0   'False
  37.       LocalPort       =   0
  38.       RemoteDotAddr   =   ""
  39.       RemoteHost      =   ""
  40.       RemotePort      =   0
  41.       ServiceName     =   ""
  42.       Timeout         =   0
  43.       Top             =   1560
  44.    End
  45. DefInt A-Z
  46. Sub dssNode_Exception (ErrorCode As Integer, ErrorDesc As String)
  47.     '-- Have we disconnected?
  48.     If ErrorCode = DSSOCK_DISCONNECTED Then
  49.         '-- Yes
  50.         Unload Me
  51.     End If
  52. End Sub
  53. Sub dssNode_Receive (ReceiveData As String)
  54. '-- We've received data!
  55.     If Len(ReceiveData) > 5 Then
  56.         '-- Is this the header?
  57.         If Left$(ReceiveData, 5) = "NAME=" Then
  58.             '-- Yes. Parse out the name
  59.             Tilde = InStr(ReceiveData, "~")
  60.             LenName = Tilde - 6
  61.             CallerName$ = Mid$(ReceiveData, 6, LenName)
  62.             Caption = CallerName$
  63.             If Len(ReceiveData) > Tilde Then
  64.                 ReceiveData = Mid$(ReceiveData, Tilde + 1)
  65.             ElseIf Len(ReceiveData) = Tilde Then
  66.                 ReceiveData = ""
  67.             End If
  68.         End If
  69.     End If
  70.     '-- Is the receieved text getting to large?
  71.     If Len(txtNode) > 15000 Then
  72.         '-- Yes. Trim it off
  73.         txtNode = Right(txtNode, 5000)
  74.     End If
  75.     '-- Set the caret to the end of the last character.
  76.     txtNode.SelStart = Len(txtNode)
  77.     '-- Add the new text
  78.     txtNode.SelText = ReceiveData
  79. End Sub
  80. Sub Form_Resize ()
  81.         
  82.     '-- Resize the text box to fit the client area.
  83.     txtNode.Width = Me.ScaleWidth
  84.     txtNode.Height = Me.ScaleHeight
  85. End Sub
  86. Sub Form_Unload (Cancel As Integer)
  87.     '-- Close the socekt connection if
  88.     '   its open
  89.     On Error Resume Next
  90.     dssNode.Action = DSSOCK_CLOSE
  91. End Sub
  92.