home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / tts.frm < prev    next >
Text File  |  1993-06-02  |  2KB  |  69 lines

  1. VERSION 2.00
  2. Begin Form TTSForm 
  3.    Caption         =   "TTS Services Test"
  4.    Height          =   2685
  5.    Left            =   1950
  6.    LinkTopic       =   "Form1"
  7.    ScaleHeight     =   2280
  8.    ScaleWidth      =   7320
  9.    Top             =   1155
  10.    Width           =   7440
  11.    Begin ListBox ServerList 
  12.       FontBold        =   -1  'True
  13.       FontItalic      =   0   'False
  14.       FontName        =   "Courier"
  15.       FontSize        =   9.75
  16.       FontStrikethru  =   0   'False
  17.       FontUnderline   =   0   'False
  18.       Height          =   1395
  19.       Left            =   120
  20.       TabIndex        =   1
  21.       Top             =   120
  22.       Width           =   7095
  23.    End
  24.    Begin CommandButton OKButton 
  25.       Caption         =   "&OK"
  26.       Height          =   375
  27.       Left            =   3120
  28.       TabIndex        =   0
  29.       Top             =   1800
  30.       Width           =   855
  31.    End
  32. End
  33. Sub Form_Load ()
  34.  
  35.     prefConnID% = GetPreferredConnectionID()
  36.  
  37.     For connID% = 1 To 8
  38.         'for each connection in workstation's file server name table
  39.         'get the table entry, then see if it's null
  40.         
  41.         serverName$ = String$(48, 0)
  42.  
  43.         If (IsConnectionIDInUse(connID%) = 1) Then
  44.             GetFileServerName connID%, serverName$
  45.             serverName$ = Left$(serverName$, InStr(serverName$, Chr$(0)) - 1)
  46.             If (Len(serverName$) > 20) Then
  47.                 serverName$ = Left$(serverName$, 20)
  48.             End If
  49.  
  50.             SetPreferredConnectionID (connID%)
  51.             ttsAvail% = TTSIsAvailable()
  52.             If (ttsAvail% = 1) Then
  53.                 ServerList.AddItem Str$(connID%) + "  " + serverName$ + String$(22 - Len(serverName$), " ") + " TTS is available"
  54.             ElseIf (ttsAvail% = 253) Then
  55.                 ServerList.AddItem Str$(connID%) + "  " + serverName$ + String$(22 - Len(serverName$), " ") + " TTS is disabled"
  56.             Else
  57.                 ServerList.AddItem Str$(connID%) + "  " + serverName$ + String$(22 - Len(serverName$), " ") + " TTS is not available"
  58.             End If
  59.         End If
  60.     Next connID%
  61.  
  62.     SetPreferredConnectionID (prefConnID%)
  63. End Sub
  64.  
  65. Sub OKButton_Click ()
  66.     Unload TTSForm
  67. End Sub
  68.  
  69.