home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / comm / vbcomm / comtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-27  |  4.8 KB  |  146 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Communcations Example"
  6.    ClientHeight    =   2655
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   4215
  10.    ControlBox      =   0   'False
  11.    Height          =   3180
  12.    Left            =   1035
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   2655
  17.    ScaleWidth      =   4215
  18.    Top             =   1020
  19.    Width           =   4335
  20.    Begin Label3D Label3D2 
  21.       AlignHor        =   0  'Left
  22.       AlignVert       =   0  'Top
  23.       BackColor       =   &H00C0C0C0&
  24.       Border          =   -1  'True
  25.       BorderWidth     =   1
  26.       Caption         =   "Output:"
  27.       Height          =   137
  28.       Left            =   0
  29.       Raised          =   -1  'True
  30.       TextShadow      =   0   'False
  31.       TextShadowCol   =   &H00000000&
  32.       Top             =   600
  33.       WaveEnabled     =   0   'False
  34.       WaveFile        =   ""
  35.       WaveLoop        =   0   'False
  36.       WaveStyle       =   0  'Synchronous
  37.       Width           =   281
  38.       Begin PictureBox Picture1 
  39.          BackColor       =   &H00FFFF00&
  40.          Height          =   1695
  41.          Left            =   60
  42.          ScaleHeight     =   1665
  43.          ScaleWidth      =   4065
  44.          TabIndex        =   4
  45.          Top             =   300
  46.          Width           =   4095
  47.       End
  48.    End
  49.    Begin Comm Comm1 
  50.       Baud            =   2  '2400
  51.       Left            =   60
  52.       Top             =   60
  53.    End
  54.    Begin Label3D Label3D1 
  55.       AlignHor        =   0  'Left
  56.       AlignVert       =   0  'Top
  57.       BackColor       =   &H00C0C0C0&
  58.       Border          =   -1  'True
  59.       BorderWidth     =   1
  60.       Height          =   41
  61.       Left            =   0
  62.       Raised          =   -1  'True
  63.       TextShadow      =   0   'False
  64.       TextShadowCol   =   &H00000000&
  65.       Top             =   0
  66.       WaveEnabled     =   0   'False
  67.       WaveFile        =   ""
  68.       WaveLoop        =   0   'False
  69.       WaveStyle       =   0  'Synchronous
  70.       Width           =   281
  71.       Begin CommandButton Command4 
  72.          Caption         =   "E&xit"
  73.          Height          =   495
  74.          Left            =   3120
  75.          TabIndex        =   3
  76.          Top             =   60
  77.          Width           =   1035
  78.       End
  79.       Begin CommandButton Command2 
  80.          Caption         =   "&Quit"
  81.          Enabled         =   0   'False
  82.          Height          =   495
  83.          Left            =   2100
  84.          TabIndex        =   1
  85.          Top             =   60
  86.          Width           =   975
  87.       End
  88.       Begin CommandButton Command1 
  89.          Caption         =   "&Begin"
  90.          Enabled         =   0   'False
  91.          Height          =   495
  92.          Left            =   1080
  93.          TabIndex        =   0
  94.          Top             =   60
  95.          Width           =   975
  96.       End
  97.       Begin CommandButton Command3 
  98.          Caption         =   "&Initialize"
  99.          Height          =   495
  100.          Left            =   60
  101.          TabIndex        =   2
  102.          Top             =   60
  103.          Width           =   975
  104.       End
  105.    End
  106. Sub Comm1_InQueue (Queued As Integer)
  107.    s$ = Comm1.DataStr                  ' Put characters in a string
  108.    Picture1.Print s$;                  ' Print the string to picture
  109. End Sub
  110. Sub Command1_Click ()
  111.    If Comm1.Enable = 0 Then      ' If not enabled...
  112.       Command3.Enabled = 1       ' Enable Initialize and
  113.       Command4.Enabled = 1       ' Exit buttons and exit
  114.       Command1.Enabled = 0
  115.       Exit Sub
  116.    End If
  117.    Command1.Enabled = 0          ' Enable Quit button
  118.    Command2.Enabled = 1
  119.    Comm1.DataStr = "ATZ" + Chr$(10) + Chr$(13)   ' Send ATZ to modem
  120.    Form3.Show                                    ' Display input form
  121. End Sub
  122. Sub Command2_Click ()
  123.    Form3.Hide                ' Kill input form
  124.    Comm1.Enable = 0          ' Disable port
  125.    Command2.Enabled = 0
  126.    Command1.Enabled = 0      ' Enable Initialize and
  127.    Command3.Enabled = 1      ' Exit buttons
  128.    Command4.Enabled = 1
  129. End Sub
  130. Sub Command3_Click ()
  131.    Form2.Show 1                       ' Display Setup Form
  132.    If Comm1.Enable = 0 Then Exit Sub  ' If not enabled, exit
  133.    Command1.Enabled = 1               ' Enable Begin button
  134.    Command3.Enabled = 0               ' Disable the rest
  135.    Command2.Enabled = 0
  136.    Command4.Enabled = 0
  137.    Picture1.Cls                       ' Clear the picture
  138. End Sub
  139. Sub Command4_Click ()
  140. End Sub
  141. Sub Form_Click ()
  142.    If Comm1.Enable <> 0 Then
  143.       Comm1.DataStr = "ATZ" + Chr$(10) + Chr$(13)
  144.    End If
  145. End Sub
  146.