Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

946 lines
30 KiB

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form frmResponse
  5. BorderStyle = 0 'None
  6. Caption = "Response State"
  7. ClientHeight = 5730
  8. ClientLeft = 0
  9. ClientTop = 0
  10. ClientWidth = 9480
  11. LinkTopic = "Form1"
  12. MDIChild = -1 'True
  13. ScaleHeight = 5730
  14. ScaleWidth = 9480
  15. ShowInTaskbar = 0 'False
  16. Visible = 0 'False
  17. Begin VB.CommandButton cmdAddValue
  18. Caption = "&Add Value"
  19. Enabled = 0 'False
  20. BeginProperty Font
  21. Name = "Small Fonts"
  22. Size = 6
  23. Charset = 0
  24. Weight = 400
  25. Underline = 0 'False
  26. Italic = 0 'False
  27. Strikethrough = 0 'False
  28. EndProperty
  29. Height = 220
  30. Left = 6465
  31. TabIndex = 7
  32. Top = 5485
  33. Visible = 0 'False
  34. Width = 930
  35. End
  36. Begin ComctlLib.StatusBar StatusBar1
  37. Align = 2 'Align Bottom
  38. Height = 300
  39. Left = 0
  40. TabIndex = 8
  41. Top = 5430
  42. Width = 9480
  43. _ExtentX = 16722
  44. _ExtentY = 529
  45. SimpleText = ""
  46. _Version = 327682
  47. BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
  48. NumPanels = 3
  49. BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  50. AutoSize = 1
  51. Object.Width = 13070
  52. TextSave = ""
  53. Key = ""
  54. Object.Tag = ""
  55. EndProperty
  56. BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  57. Style = 6
  58. AutoSize = 2
  59. Object.Width = 1773
  60. MinWidth = 1764
  61. TextSave = "9/16/98"
  62. Key = ""
  63. Object.Tag = ""
  64. EndProperty
  65. BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7}
  66. Style = 5
  67. AutoSize = 2
  68. Object.Width = 1773
  69. MinWidth = 1764
  70. TextSave = "1:05 PM"
  71. Key = ""
  72. Object.Tag = ""
  73. EndProperty
  74. EndProperty
  75. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  76. Name = "MS Sans Serif"
  77. Size = 8.25
  78. Charset = 0
  79. Weight = 700
  80. Underline = 0 'False
  81. Italic = 0 'False
  82. Strikethrough = 0 'False
  83. EndProperty
  84. End
  85. Begin TabDlg.SSTab SSTab1
  86. Height = 5055
  87. Left = 0
  88. TabIndex = 1
  89. TabStop = 0 'False
  90. Top = 360
  91. Width = 9405
  92. _ExtentX = 16589
  93. _ExtentY = 8916
  94. _Version = 393216
  95. Tabs = 5
  96. Tab = 3
  97. TabsPerRow = 8
  98. TabHeight = 794
  99. ShowFocusRect = 0 'False
  100. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  101. Name = "MS Sans Serif"
  102. Size = 8.25
  103. Charset = 0
  104. Weight = 400
  105. Underline = 0 'False
  106. Italic = 0 'False
  107. Strikethrough = 0 'False
  108. EndProperty
  109. TabCaption(0) = "Response Text"
  110. TabPicture(0) = "frmResponse.frx":0000
  111. Tab(0).ControlEnabled= 0 'False
  112. Tab(0).Control(0)= "Combo1"
  113. Tab(0).Control(0).Enabled= 0 'False
  114. Tab(0).ControlCount= 1
  115. TabCaption(1) = " Response State"
  116. TabPicture(1) = "frmResponse.frx":001C
  117. Tab(1).ControlEnabled= 0 'False
  118. Tab(1).Control(0)= "Combo2"
  119. Tab(1).Control(0).Enabled= 0 'False
  120. Tab(1).ControlCount= 1
  121. TabCaption(2) = "Negotiated Options"
  122. TabPicture(2) = "frmResponse.frx":0038
  123. Tab(2).ControlEnabled= 0 'False
  124. Tab(2).Control(0)= "List1"
  125. Tab(2).ControlCount= 1
  126. TabCaption(3) = "Negotiated DCE Rate"
  127. TabPicture(3) = "frmResponse.frx":0054
  128. Tab(3).ControlEnabled= -1 'True
  129. Tab(3).Control(0)= "Combo3"
  130. Tab(3).Control(0).Enabled= 0 'False
  131. Tab(3).ControlCount= 1
  132. TabCaption(4) = "Negotiated DTE Rate"
  133. TabPicture(4) = "frmResponse.frx":0070
  134. Tab(4).ControlEnabled= 0 'False
  135. Tab(4).Control(0)= "Combo4"
  136. Tab(4).Control(0).Enabled= 0 'False
  137. Tab(4).ControlCount= 1
  138. Begin VB.ComboBox Combo4
  139. BeginProperty Font
  140. Name = "MS Sans Serif"
  141. Size = 9.75
  142. Charset = 0
  143. Weight = 400
  144. Underline = 0 'False
  145. Italic = 0 'False
  146. Strikethrough = 0 'False
  147. EndProperty
  148. Height = 360
  149. ItemData = "frmResponse.frx":008C
  150. Left = -74880
  151. List = "frmResponse.frx":00F6
  152. TabIndex = 6
  153. Top = 600
  154. Width = 9135
  155. End
  156. Begin VB.ComboBox Combo3
  157. BeginProperty Font
  158. Name = "MS Sans Serif"
  159. Size = 9.75
  160. Charset = 0
  161. Weight = 400
  162. Underline = 0 'False
  163. Italic = 0 'False
  164. Strikethrough = 0 'False
  165. EndProperty
  166. Height = 360
  167. ItemData = "frmResponse.frx":01DC
  168. Left = 120
  169. List = "frmResponse.frx":024F
  170. TabIndex = 5
  171. Top = 600
  172. Width = 9135
  173. End
  174. Begin VB.ListBox List1
  175. Columns = 1
  176. Enabled = 0 'False
  177. Height = 4335
  178. ItemData = "frmResponse.frx":034C
  179. Left = -74880
  180. List = "frmResponse.frx":0368
  181. Style = 1 'Checkbox
  182. TabIndex = 4
  183. Top = 600
  184. Width = 9135
  185. End
  186. Begin VB.ComboBox Combo2
  187. BeginProperty Font
  188. Name = "MS Sans Serif"
  189. Size = 9.75
  190. Charset = 0
  191. Weight = 400
  192. Underline = 0 'False
  193. Italic = 0 'False
  194. Strikethrough = 0 'False
  195. EndProperty
  196. Height = 360
  197. ItemData = "frmResponse.frx":03D1
  198. Left = -74880
  199. List = "frmResponse.frx":0417
  200. TabIndex = 3
  201. Top = 600
  202. Width = 9135
  203. End
  204. Begin VB.ComboBox Combo1
  205. BeginProperty Font
  206. Name = "MS Sans Serif"
  207. Size = 9.75
  208. Charset = 0
  209. Weight = 400
  210. Underline = 0 'False
  211. Italic = 0 'False
  212. Strikethrough = 0 'False
  213. EndProperty
  214. Height = 360
  215. Left = -74880
  216. Style = 1 'Simple Combo
  217. TabIndex = 2
  218. Top = 600
  219. Width = 9135
  220. End
  221. End
  222. Begin VB.TextBox Text1
  223. Height = 285
  224. Left = 0
  225. TabIndex = 0
  226. Top = 0
  227. Width = 9495
  228. End
  229. Begin VB.Label Label1
  230. Caption = "Response"
  231. Height = 495
  232. Left = 4200
  233. TabIndex = 9
  234. Top = 2280
  235. Width = 1215
  236. End
  237. End
  238. Attribute VB_Name = "frmResponse"
  239. Attribute VB_GlobalNameSpace = False
  240. Attribute VB_Creatable = False
  241. Attribute VB_PredeclaredId = True
  242. Attribute VB_Exposed = False
  243. Dim HKR As String
  244. Dim Response As String
  245. Dim State As String
  246. Dim Options As String
  247. Dim Options2 As String
  248. Dim DCE As String
  249. Dim DTE As String
  250. Dim Output As String
  251. Dim Comment(31) As String
  252. Dim Tem As Integer
  253. Const Q As String = """"
  254. Const Delim As String = ","
  255. Const One As String = ", 1, "
  256. Const H As String = "&H"
  257. Dim FirstDword1, FirstDword2, FirstDword3, FirstDword4 As Variant
  258. Dim SecondDword1, SecondDword2, SecondDword3, SecondDword4 As Variant
  259. Dim WhichTab As Integer
  260. Private Sub Combo1_KeyPress(KeyAscii As Integer)
  261. If KeyAscii = 13 Then
  262. Response = Combo1.Text
  263. Update
  264. Dim strFirst As String
  265. strFirst = Len(HKR & Q)
  266. Text1.SelStart = strFirst
  267. Text1.SelLength = Len(Response)
  268. Text1.SetFocus
  269. End If
  270. End Sub
  271. Private Sub Combo1_LostFocus()
  272. Response = Combo1.Text
  273. Update
  274. End Sub
  275. Private Sub Combo2_Click()
  276. ChangeState (Combo2.Text)
  277. Dim strFirst As String
  278. strFirst = Len(HKR & Q & Response & Q & One & " ")
  279. Text1.SelStart = strFirst
  280. Text1.SelLength = Len(State)
  281. Text1.SetFocus
  282. End Sub
  283. Private Sub Combo2_KeyPress(KeyAscii As Integer)
  284. If KeyAscii = 13 Then
  285. ChangeState (Combo2.Text)
  286. strFirst = Len(HKR & Q & Response & Q & One & " ")
  287. Text1.SelStart = strFirst
  288. Text1.SelLength = Len(State)
  289. Text1.SetFocus
  290. End If
  291. End Sub
  292. Private Sub Combo2_LostFocus()
  293. ChangeState (Combo2.Text)
  294. End Sub
  295. Private Sub Combo3_Click()
  296. DCE = Combo3.Text
  297. If DCE = "" Then
  298. DCE = 0
  299. End If
  300. If DCE > 100000000 Then
  301. DCE = 0
  302. Combo3.Text = 0
  303. End If
  304. HexCon (DCE)
  305. DCE = HexNum
  306. Update
  307. Dim strFirst As String
  308. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " ")
  309. Text1.SelStart = strFirst
  310. Text1.SelLength = Len(DCE)
  311. Text1.SetFocus
  312. End Sub
  313. Private Sub Combo3_KeyPress(KeyAscii As Integer)
  314. If KeyAscii = 13 Then
  315. DCE = Combo3.Text
  316. If DCE = "" Then
  317. DCE = 0
  318. End If
  319. If DCE > 100000000 Then
  320. DCE = 0
  321. Combo3.Text = 0
  322. End If
  323. HexCon (DCE)
  324. DCE = HexNum
  325. Update
  326. Dim strFirst As String
  327. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " ")
  328. Text1.SelStart = strFirst
  329. Text1.SelLength = Len(DCE)
  330. Text1.SetFocus
  331. ElseIf (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
  332. Beep
  333. KeyAscii = 0
  334. End If
  335. End Sub
  336. Private Sub Combo3_LostFocus()
  337. DCE = Combo3.Text
  338. If DCE = "" Then
  339. DCE = 0
  340. End If
  341. If DCE > 100000000 Then
  342. DCE = 0
  343. Combo3.Text = 0
  344. End If
  345. HexCon (DCE)
  346. DCE = HexNum
  347. Update
  348. End Sub
  349. Private Sub Combo4_Click()
  350. DTE = Combo4.Text
  351. If DTE = "" Then
  352. DTE = 0
  353. End If
  354. If DTE > 100000000 Then
  355. DTE = 0
  356. Combo3.Text = 0
  357. End If
  358. HexCon (DTE)
  359. DTE = HexNum
  360. Update
  361. Dim strFirst As String
  362. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " " & DCE & Delim & " ")
  363. Text1.SelStart = strFirst
  364. Text1.SelLength = Len(DTE)
  365. Text1.SetFocus
  366. End Sub
  367. Private Sub Combo4_KeyPress(KeyAscii As Integer)
  368. If KeyAscii = 13 Then
  369. DTE = Combo4.Text
  370. If DTE = "" Then
  371. DTE = 0
  372. End If
  373. If DTE > 100000000 Then
  374. DTE = 0
  375. Combo4.Text = 0
  376. End If
  377. HexCon (DTE)
  378. DTE = HexNum
  379. Update
  380. Dim strFirst As String
  381. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " " & DCE & Delim & " ")
  382. Text1.SelStart = strFirst
  383. Text1.SelLength = Len(DTE)
  384. Text1.SetFocus
  385. ElseIf (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
  386. Beep
  387. KeyAscii = 0
  388. End If
  389. End Sub
  390. Private Sub Combo4_LostFocus()
  391. DTE = Combo4.Text
  392. If DTE = "" Then
  393. DTE = 0
  394. End If
  395. If DTE > 100000000 Then
  396. DTE = 0
  397. Combo4.Text = 0
  398. End If
  399. HexCon (DTE)
  400. DTE = HexNum
  401. Update
  402. End Sub
  403. Public Sub ClearControl()
  404. HKR = "HKR, Responses, "
  405. Response = ""
  406. Combo1 = ""
  407. State = "00"
  408. Combo2 = "OK"
  409. Options = "00"
  410. Options2 = "00"
  411. Dim i As Integer
  412. For i = 0 To 7
  413. List1.Selected(i) = False
  414. Next i
  415. List1.Enabled = False
  416. DCE = "0"
  417. HexCon (DCE)
  418. DCE = HexNum
  419. Combo3 = ""
  420. DTE = "0"
  421. HexCon (DTE)
  422. DTE = HexNum
  423. Combo4 = ""
  424. Update
  425. SSTab1.Tab = 0
  426. Dim strFirst As String
  427. strFirst = Len(HKR & Q)
  428. Text1.SelStart = strFirst
  429. Text1.SelLength = Len(Response)
  430. If frmResponse.Visible = False Then
  431. frmResponse.Show
  432. End If
  433. Text1.SetFocus
  434. StatusBar1.Panels.Item(1).Text = "Comment1"
  435. End Sub
  436. Public Sub Paste(Incoming As String)
  437. ClearControl
  438. GetWord (Incoming)
  439. If SecondDword4 = "" Then
  440. Message = MsgBox(Q & Incoming & Q & " is not a valid input")
  441. ClearControl
  442. Else
  443. 'Take all the values, assign them to their respective controls and then use Update() to create Output
  444. Combo1.Text = Response
  445. PasteResponse (State)
  446. Dim X
  447. X = (H & Options2)
  448. List1.Selected(0) = X And &H1
  449. List1.Selected(1) = X And &H2
  450. List1.Selected(2) = X And &H4
  451. List1.Selected(3) = X And &H8
  452. List1.Selected(4) = X And &H10
  453. List1.Selected(5) = X And &H20
  454. List1.Selected(6) = X And &H40
  455. List1.Selected(7) = X And &H80
  456. Options = Options2
  457. Combo3.Text = CDec(H & FirstDword4 & FirstDword3 & FirstDword2 & FirstDword1)
  458. DCE = Combo3.Text
  459. HexCon (DCE)
  460. DCE = HexNum
  461. Combo4.Text = CDec(H & SecondDword4 & SecondDword3 & SecondDword2 & SecondDword1)
  462. DTE = Combo4.Text
  463. HexCon (DTE)
  464. DTE = HexNum
  465. Update
  466. SSTab1.Tab = 0
  467. Dim strFirst As String
  468. strFirst = Len(HKR & Q)
  469. Text1.SelStart = strFirst
  470. Text1.SelLength = Len(Response)
  471. Text1.SetFocus
  472. End If
  473. End Sub
  474. Private Sub GetWord(strString As String)
  475. Dim strSubString As String
  476. Dim lStart As Long
  477. Dim lStop As Long
  478. Const H As String = "&H"
  479. lStart = 1
  480. lStop = Len(strString)
  481. While lStart < lStop And Q <> Mid$(strString, lStart, 1) ' Loop until first " found
  482. lStart = lStart + 1
  483. Wend
  484. lStop = lStart
  485. While Q <> Mid$(strString, lStop + 1, 1) And lStop <= Len(strString) ' Loop until last " found
  486. lStop = lStop + 1
  487. Wend
  488. Response = Mid$(strString, lStart + 1, lStop - lStart) ' Grab word found between "'s
  489. strSubString = Mid$(strString, lStop + 2)
  490. lStart = 1
  491. lStop = Len(strSubString)
  492. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  493. lStart = lStart + 1
  494. Wend
  495. lStop = lStart
  496. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  497. lStop = lStop + 1
  498. Wend
  499. 'One = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  500. strSubString = Mid$(strSubString, lStop + 1)
  501. 'Clean (One)
  502. 'One = Right$(BNum, 1)
  503. lStart = 1
  504. lStop = Len(strSubString)
  505. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  506. lStart = lStart + 1
  507. Wend
  508. lStop = lStart
  509. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  510. lStop = lStop + 1
  511. Wend
  512. State = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  513. strSubString = Mid$(strSubString, lStop + 1)
  514. Clean (State)
  515. State = CleanNum
  516. lStart = 1
  517. lStop = Len(strSubString)
  518. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  519. lStart = lStart + 1
  520. Wend
  521. lStop = lStart
  522. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  523. lStop = lStop + 1
  524. Wend
  525. Options2 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  526. strSubString = Mid$(strSubString, lStop + 1)
  527. Clean (Options2)
  528. Options2 = CleanNum
  529. lStart = 1
  530. lStop = Len(strSubString)
  531. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  532. lStart = lStart + 1
  533. Wend
  534. lStop = lStart
  535. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  536. lStop = lStop + 1
  537. Wend
  538. FirstDword1 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  539. strSubString = Mid$(strSubString, lStop + 1)
  540. Clean (FirstDword1)
  541. FirstDword1 = CleanNum
  542. lStart = 1
  543. lStop = Len(strSubString)
  544. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  545. lStart = lStart + 1
  546. Wend
  547. lStop = lStart
  548. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  549. lStop = lStop + 1
  550. Wend
  551. FirstDword2 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  552. strSubString = Mid$(strSubString, lStop + 1)
  553. Clean (FirstDword2)
  554. FirstDword2 = CleanNum
  555. lStart = 1
  556. lStop = Len(strSubString)
  557. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  558. lStart = lStart + 1
  559. Wend
  560. lStop = lStart
  561. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  562. lStop = lStop + 1
  563. Wend
  564. FirstDword3 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  565. strSubString = Mid$(strSubString, lStop + 1)
  566. Clean (FirstDword3)
  567. FirstDword3 = CleanNum
  568. lStart = 1
  569. lStop = Len(strSubString)
  570. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  571. lStart = lStart + 1
  572. Wend
  573. lStop = lStart
  574. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  575. lStop = lStop + 1
  576. Wend
  577. FirstDword4 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  578. strSubString = Mid$(strSubString, lStop + 1)
  579. Clean (FirstDword4)
  580. FirstDword4 = CleanNum
  581. lStart = 1
  582. lStop = Len(strSubString)
  583. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  584. lStart = lStart + 1
  585. Wend
  586. lStop = lStart
  587. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  588. lStop = lStop + 1
  589. Wend
  590. SecondDword1 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  591. strSubString = Mid$(strSubString, lStop + 1)
  592. Clean (SecondDword1)
  593. SecondDword1 = CleanNum
  594. lStart = 1
  595. lStop = Len(strSubString)
  596. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  597. lStart = lStart + 1
  598. Wend
  599. lStop = lStart
  600. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  601. lStop = lStop + 1
  602. Wend
  603. SecondDword2 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  604. strSubString = Mid$(strSubString, lStop + 1)
  605. Clean (SecondDword2)
  606. SecondDword2 = CleanNum
  607. lStart = 1
  608. lStop = Len(strSubString)
  609. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  610. lStart = lStart + 1
  611. Wend
  612. lStop = lStart
  613. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) ' Loop until last , found
  614. lStop = lStop + 1
  615. Wend
  616. SecondDword3 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  617. strSubString = Mid$(strSubString, lStop + 1)
  618. Clean (SecondDword3)
  619. SecondDword3 = CleanNum
  620. lStart = 1
  621. lStop = Len(strSubString)
  622. While lStart < lStop And "," <> Mid$(strSubString, lStart, 1) ' Loop until first , found
  623. lStart = lStart + 1
  624. Wend
  625. lStop = lStart
  626. While "," <> Mid$(strSubString, lStop + 1, 1) And lStop <= Len(strSubString) And " " <> Mid$(strSubString, lStop + 1, 1) And vbTab <> Mid$(strSubString, lStop + 1, 1) ' Loop until last , found
  627. lStop = lStop + 1
  628. Wend
  629. SecondDword4 = Mid$(strSubString, lStart + 1, lStop - 1) ' Grab word found between ,'s
  630. strSubString = Mid$(strSubString, lStop + 1)
  631. Clean (SecondDword4)
  632. SecondDword4 = CleanNum
  633. End Sub
  634. Private Sub Update()
  635. Output = HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " " & DCE & Delim & " " & DTE
  636. Text1.Text = Output
  637. End Sub
  638. Public Sub PasteResponse(Number As String)
  639. frmResponse.List1.Enabled = False
  640. Select Case Number
  641. Case "00"
  642. Combo2.Text = "OK"
  643. Case "01"
  644. Combo2.Text = "Negotiation Progress"
  645. frmResponse.List1.Enabled = True
  646. Case "02"
  647. Combo2.Text = "Connect"
  648. frmResponse.List1.Enabled = True
  649. Case "03"
  650. Combo2.Text = "Error"
  651. Case "04"
  652. Combo2.Text = "No Carrier"
  653. Case "05"
  654. Combo2.Text = "No Dialtone"
  655. Case "06"
  656. Combo2.Text = "Busy"
  657. Case "07"
  658. Combo2.Text = "No Answer"
  659. Case "08"
  660. Combo2.Text = "Ring"
  661. Case "91"
  662. Combo2.Text = "Ring Duration"
  663. Case "92"
  664. Combo2.Text = "Ring Break"
  665. Case "93"
  666. Combo2.Text = "Date"
  667. Case "94"
  668. Combo2.Text = "Time"
  669. Case "95"
  670. Combo2.Text = "Number"
  671. Case "96"
  672. Combo2.Text = "Name"
  673. Case "97"
  674. Combo2.Text = "Message"
  675. Case "18"
  676. Combo2.Text = "Single Ring"
  677. Case "19"
  678. Combo2.Text = "Double Ring"
  679. Case "1A"
  680. Combo2.Text = "Triple Ring"
  681. Case "1B"
  682. Combo2.Text = "Reserved"
  683. Case "1C"
  684. Combo2.Text = "Blocked"
  685. Case "1D"
  686. Combo2.Text = "Delayed"
  687. Case Else
  688. Combo2.Text = "Unrecognized"
  689. End Select
  690. End Sub
  691. Private Sub ChangeState(UserInput As String)
  692. UserInput = UCase(UserInput)
  693. Select Case UserInput
  694. Case "OK"
  695. State = "00"
  696. frmResponse.List1.Enabled = False
  697. Case "VCON"
  698. State = "00"
  699. frmResponse.List1.Enabled = False
  700. Case "NEGOTIATION PROGRESS"
  701. State = "01"
  702. frmResponse.List1.Enabled = True
  703. Case "CONNECT"
  704. State = "02"
  705. frmResponse.List1.Enabled = True
  706. Case "ERROR"
  707. State = "03"
  708. frmResponse.List1.Enabled = False
  709. Case "NO CARRIER"
  710. State = "04"
  711. frmResponse.List1.Enabled = False
  712. Case "NO DIALTONE"
  713. State = "05"
  714. frmResponse.List1.Enabled = False
  715. Case "BUSY"
  716. State = "06"
  717. frmResponse.List1.Enabled = False
  718. Case "NO ANSWER"
  719. State = "07"
  720. frmResponse.List1.Enabled = False
  721. Case "RING"
  722. State = "08"
  723. frmResponse.List1.Enabled = False
  724. Case "RING DURATION"
  725. State = "91"
  726. frmResponse.List1.Enabled = False
  727. Case "RING BREAK"
  728. State = "92"
  729. frmResponse.List1.Enabled = False
  730. Case "DATE"
  731. State = "93"
  732. frmResponse.List1.Enabled = False
  733. Case "TIME"
  734. State = "94"
  735. frmResponse.List1.Enabled = False
  736. Case "NUMBER"
  737. State = "95"
  738. frmResponse.List1.Enabled = False
  739. Case "NAME"
  740. State = "96"
  741. frmResponse.List1.Enabled = False
  742. Case "MESSAGE"
  743. State = "97"
  744. frmResponse.List1.Enabled = False
  745. Case "SINGLE RING"
  746. State = "18"
  747. frmResponse.List1.Enabled = False
  748. Case "DOUBLE RING"
  749. State = "19"
  750. frmResponse.List1.Enabled = False
  751. Case "TRIPLE RING"
  752. State = "1A"
  753. frmResponse.List1.Enabled = False
  754. 'Case "RESERVED"
  755. 'State = "1B"
  756. Case "BLOCKED"
  757. State = "1C"
  758. frmResponse.List1.Enabled = False
  759. Case "DELAYED"
  760. State = "1D"
  761. frmResponse.List1.Enabled = False
  762. Case Else
  763. State = "00"
  764. frmResponse.List1.Enabled = False
  765. Combo2.Text = "Unrecognized"
  766. End Select
  767. Update
  768. End Sub
  769. Private Sub Form_Load()
  770. Comment(0) = "Compression negotiated."
  771. Comment(1) = "Error control negotiated."
  772. Comment(2) = ""
  773. Comment(3) = "Cellular protocol negotiated.Unavailable unless Error Control is selected."
  774. Comment(4) = ""
  775. Comment(5) = ""
  776. Comment(6) = ""
  777. Comment(7) = ""
  778. ClearControl
  779. End Sub
  780. Private Sub Form_Resize()
  781. Text1.Width = frmResponse.Width
  782. SSTab1.Width = frmResponse.Width - 75
  783. SSTab1.Height = frmResponse.Height - 675
  784. List1.Height = SSTab1.Height - 645
  785. List1.Width = SSTab1.Width - 270
  786. cmdAddValue.Top = frmResponse.Height - 245
  787. cmdAddValue.Left = frmResponse.Width - 3015
  788. Combo1.Width = SSTab1.Width - 270
  789. Combo2.Width = SSTab1.Width - 270
  790. Combo3.Width = SSTab1.Width - 270
  791. Combo4.Width = SSTab1.Width - 270
  792. End Sub
  793. Private Sub List1_Click()
  794. List1.Refresh
  795. StatusBar1.Panels.Item(1).Text = Comment(List1.ListIndex)
  796. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " ")
  797. Text1.SelStart = strFirst
  798. Text1.SelLength = Len(Options)
  799. Text1.SetFocus
  800. End Sub
  801. Private Sub List1_ItemCheck(Item As Integer)
  802. Dim Num As Long
  803. Dim Number As Long
  804. Number = CDec(H & Options)
  805. Num = CDec(H & List1.ItemData(Item))
  806. If List1.Selected(Item) = True Then
  807. Options = Hex(Num + Number)
  808. ElseIf Options <> "00" Then
  809. Options = Hex(Number - Num)
  810. End If
  811. If Len(Options) < 2 Then
  812. Options = "0" & Options
  813. End If
  814. Update
  815. End Sub
  816. Private Sub SSTab1_Click(PreviousTab As Integer)
  817. Dim CurrentTab As Integer
  818. Dim strFirst As Integer
  819. CurrentTab = SSTab1.Tab + 1
  820. Select Case CurrentTab
  821. Case "1"
  822. strFirst = Len(HKR & Q)
  823. Text1.SelStart = strFirst
  824. Text1.SelLength = Len(Response)
  825. StatusBar1.Panels.Item(1).Text = ""
  826. cmdAddValue.Enabled = False
  827. Case "2"
  828. strFirst = Len(HKR & Q & Response & Q & One & " ")
  829. Text1.SelStart = strFirst
  830. Text1.SelLength = Len(State)
  831. StatusBar1.Panels.Item(1).Text = "Data/Fax modem response."
  832. cmdAddValue.Enabled = False
  833. Case "3"
  834. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " ")
  835. Text1.SelStart = strFirst
  836. Text1.SelLength = Len(Options)
  837. StatusBar1.Panels.Item(1).Text = "Used only for Response States of type Negotiation Progress or Connect. "
  838. cmdAddValue.Enabled = True
  839. Case "4"
  840. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " ")
  841. Text1.SelStart = strFirst
  842. Text1.SelLength = Len(DCE)
  843. StatusBar1.Panels.Item(1).Text = "Specifies the modem-to-modem line speed negotiated."
  844. cmdAddValue.Enabled = False
  845. Case "5"
  846. strFirst = Len(HKR & Q & Response & Q & One & " " & State & Delim & " " & Options & Delim & " " & DCE & Delim & " ")
  847. Text1.SelStart = strFirst
  848. Text1.SelLength = Len(DTE)
  849. StatusBar1.Panels.Item(1).Text = "Specified only to cause Unimodem to change its DTE port speed."
  850. cmdAddValue.Enabled = False
  851. End Select
  852. Text1.SetFocus
  853. End Sub
  854. Public Sub EditCopy()
  855. Text1.SelStart = 0
  856. Text1.SelLength = Len(Text1.Text)
  857. Text1.SetFocus
  858. Clipboard.Clear
  859. Clipboard.SetText Text1.Text
  860. End Sub
  861. Public Sub EditPaste()
  862. Paste (Clipboard.GetText)
  863. End Sub
  864. Private Sub Text1_Click()
  865. Dim Start As Integer
  866. Dim Plus As Integer
  867. Plus = Len(Response)
  868. Start = Text1.SelStart
  869. If 16 < Start And Start < (18 + Plus) Then
  870. If SSTab1.Tab = 0 Then
  871. Exit Sub
  872. End If
  873. SSTab1.Tab = 0
  874. End If
  875. If (21 + Plus) < Start And Start < (27 + Plus) Then
  876. If SSTab1.Tab = 1 Then
  877. Exit Sub
  878. End If
  879. SSTab1.Tab = 1
  880. End If
  881. If (26 + Plus) < Start And Start < (32 + Plus) Then
  882. If SSTab1.Tab = 2 Then
  883. Exit Sub
  884. End If
  885. SSTab1.Tab = 2
  886. End If
  887. If (31 + Plus) < Start And Start < (46 + Plus) Then
  888. If SSTab1.Tab = 3 Then
  889. Exit Sub
  890. End If
  891. SSTab1.Tab = 3
  892. End If
  893. If (45 + Plus) < Start And Start < (60 + Plus) Then
  894. If SSTab1.Tab = 4 Then
  895. Exit Sub
  896. End If
  897. SSTab1.Tab = 4
  898. End If
  899. ' MsgBox Text1.SelStart
  900. End Sub
  901. Private Sub Text1_KeyPress(KeyAscii As Integer)
  902. If KeyAscii = 13 Then
  903. WhichTab = SSTab1.Tab
  904. Paste (Text1.Text)
  905. SSTab1.Tab = WhichTab
  906. End If
  907. End Sub