home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pc3270sa.zip / vbdde / ffindfld.frm next >
Text File  |  2002-02-28  |  22KB  |  710 lines

  1. VERSION 4.00
  2. Begin VB.Form FormFindField 
  3.    Caption         =   "Find Field"
  4.    ClientHeight    =   5988
  5.    ClientLeft      =   1632
  6.    ClientTop       =   1740
  7.    ClientWidth     =   5784
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   7.8
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   6312
  19.    Left            =   1584
  20.    LinkMode        =   1  'Source
  21.    LinkTopic       =   "Form6"
  22.    ScaleHeight     =   5988
  23.    ScaleWidth      =   5784
  24.    Top             =   1464
  25.    Width           =   5880
  26.    Begin VB.ComboBox SessionIdList 
  27.       BackColor       =   &H00FFFFC0&
  28.       ForeColor       =   &H00000000&
  29.       Height          =   288
  30.       ItemData        =   "FFINDFLD.frx":0000
  31.       Left            =   360
  32.       List            =   "FFINDFLD.frx":0052
  33.       Sorted          =   -1  'True
  34.       Style           =   2  'Dropdown List
  35.       TabIndex        =   2
  36.       Top             =   720
  37.       Width           =   492
  38.    End
  39.    Begin VB.TextBox FIndFieldDataText 
  40.       Height          =   372
  41.       Left            =   5088
  42.       TabIndex        =   8
  43.       Top             =   5520
  44.       Visible         =   0   'False
  45.       Width           =   300
  46.    End
  47.    Begin VB.CommandButton ExitDlg 
  48.       Cancel          =   -1  'True
  49.       Caption         =   "E&xit"
  50.       Height          =   372
  51.       Left            =   3840
  52.       TabIndex        =   9
  53.       Top             =   5520
  54.       Width           =   972
  55.    End
  56.    Begin VB.CommandButton Execute 
  57.       Caption         =   "&Execute"
  58.       Default         =   -1  'True
  59.       Height          =   372
  60.       Left            =   672
  61.       TabIndex        =   7
  62.       Top             =   5520
  63.       Width           =   876
  64.    End
  65.    Begin VB.Frame Frame1 
  66.       Caption         =   "Output Information"
  67.       ForeColor       =   &H80000008&
  68.       Height          =   3612
  69.       Left            =   120
  70.       TabIndex        =   10
  71.       Top             =   1800
  72.       Width           =   5580
  73.       Begin VB.Label FieldDataLabel9 
  74.          ForeColor       =   &H80000008&
  75.          Height          =   252
  76.          Left            =   2208
  77.          TabIndex        =   28
  78.          Top             =   3240
  79.          Width           =   3276
  80.       End
  81.       Begin VB.Label FieldLabel9 
  82.          ForeColor       =   &H80000008&
  83.          Height          =   252
  84.          Left            =   96
  85.          TabIndex        =   26
  86.          Top             =   3240
  87.          Width           =   2028
  88.       End
  89.       Begin VB.Label FieldDataLabel8 
  90.          ForeColor       =   &H80000008&
  91.          Height          =   252
  92.          Left            =   2208
  93.          TabIndex        =   27
  94.          Top             =   2880
  95.          Width           =   3276
  96.       End
  97.       Begin VB.Label FieldLabel8 
  98.          ForeColor       =   &H80000008&
  99.          Height          =   252
  100.          Left            =   96
  101.          TabIndex        =   25
  102.          Top             =   2880
  103.          Width           =   2028
  104.       End
  105.       Begin VB.Label FieldDataLabel7 
  106.          ForeColor       =   &H80000008&
  107.          Height          =   252
  108.          Left            =   2208
  109.          TabIndex        =   24
  110.          Top             =   2520
  111.          Width           =   3276
  112.       End
  113.       Begin VB.Label FieldLabel7 
  114.          ForeColor       =   &H80000008&
  115.          Height          =   252
  116.          Left            =   96
  117.          TabIndex        =   17
  118.          Top             =   2520
  119.          Width           =   2028
  120.       End
  121.       Begin VB.Label FieldDataLabel6 
  122.          ForeColor       =   &H80000008&
  123.          Height          =   252
  124.          Left            =   2208
  125.          TabIndex        =   23
  126.          Top             =   2160
  127.          Width           =   3276
  128.       End
  129.       Begin VB.Label FieldLabel6 
  130.          ForeColor       =   &H80000008&
  131.          Height          =   252
  132.          Left            =   96
  133.          TabIndex        =   16
  134.          Top             =   2160
  135.          Width           =   2028
  136.       End
  137.       Begin VB.Label FieldDataLabel5 
  138.          ForeColor       =   &H80000008&
  139.          Height          =   252
  140.          Left            =   2208
  141.          TabIndex        =   22
  142.          Top             =   1800
  143.          Width           =   3276
  144.       End
  145.       Begin VB.Label FieldLabel5 
  146.          ForeColor       =   &H80000008&
  147.          Height          =   252
  148.          Left            =   96
  149.          TabIndex        =   15
  150.          Top             =   1800
  151.          Width           =   2028
  152.       End
  153.       Begin VB.Label FIeldDataLabel4 
  154.          ForeColor       =   &H80000008&
  155.          Height          =   252
  156.          Left            =   2208
  157.          TabIndex        =   21
  158.          Top             =   1440
  159.          Width           =   3276
  160.       End
  161.       Begin VB.Label FieldLabel4 
  162.          ForeColor       =   &H80000008&
  163.          Height          =   252
  164.          Left            =   96
  165.          TabIndex        =   14
  166.          Top             =   1440
  167.          Width           =   2028
  168.       End
  169.       Begin VB.Label FieldDataLabel3 
  170.          ForeColor       =   &H80000008&
  171.          Height          =   252
  172.          Left            =   2208
  173.          TabIndex        =   20
  174.          Top             =   1080
  175.          Width           =   3276
  176.       End
  177.       Begin VB.Label FieldLabel3 
  178.          ForeColor       =   &H80000008&
  179.          Height          =   252
  180.          Left            =   96
  181.          TabIndex        =   13
  182.          Top             =   1080
  183.          Width           =   2028
  184.       End
  185.       Begin VB.Label FieldDataLabel2 
  186.          ForeColor       =   &H80000008&
  187.          Height          =   252
  188.          Left            =   2208
  189.          TabIndex        =   19
  190.          Top             =   720
  191.          Width           =   3276
  192.       End
  193.       Begin VB.Label FieldLabel2 
  194.          ForeColor       =   &H80000008&
  195.          Height          =   252
  196.          Left            =   96
  197.          TabIndex        =   12
  198.          Top             =   720
  199.          Width           =   2028
  200.       End
  201.       Begin VB.Label FieldDataLabel1 
  202.          ForeColor       =   &H80000008&
  203.          Height          =   252
  204.          Left            =   2208
  205.          TabIndex        =   18
  206.          Top             =   360
  207.          Width           =   3276
  208.       End
  209.       Begin VB.Label FieldLabel1 
  210.          Caption         =   "Formatted/Unformatted:"
  211.          ForeColor       =   &H80000008&
  212.          Height          =   252
  213.          Index           =   0
  214.          Left            =   120
  215.          TabIndex        =   11
  216.          Top             =   360
  217.          Width           =   2028
  218.       End
  219.    End
  220.    Begin VB.Frame Frame2 
  221.       Caption         =   "Input Parameters"
  222.       ForeColor       =   &H80000008&
  223.       Height          =   1572
  224.       Left            =   120
  225.       TabIndex        =   0
  226.       Top             =   120
  227.       Width           =   5532
  228.       Begin VB.Frame Frame5 
  229.          Caption         =   "Session &Id"
  230.          Height          =   732
  231.          Left            =   120
  232.          TabIndex        =   1
  233.          Top             =   360
  234.          Width           =   1812
  235.          Begin VB.Label SessionTypeLabel 
  236.             Height          =   372
  237.             Left            =   720
  238.             TabIndex        =   30
  239.             Top             =   240
  240.             Width           =   972
  241.          End
  242.       End
  243.       Begin VB.TextBox FindStartPosText 
  244.          BackColor       =   &H00FFFFC0&
  245.          ForeColor       =   &H00000000&
  246.          Height          =   288
  247.          Left            =   2160
  248.          MaxLength       =   4
  249.          TabIndex        =   4
  250.          Top             =   360
  251.          Width           =   492
  252.       End
  253.       Begin VB.Frame Frame3 
  254.          Caption         =   "&Field to Find"
  255.          Height          =   612
  256.          Left            =   2040
  257.          TabIndex        =   5
  258.          Top             =   840
  259.          Width           =   3372
  260.          Begin VB.ComboBox FindStartPosOption 
  261.             BackColor       =   &H00FFFFC0&
  262.             Height          =   288
  263.             ItemData        =   "FFINDFLD.frx":00A4
  264.             Left            =   120
  265.             List            =   "FFINDFLD.frx":00C0
  266.             TabIndex        =   6
  267.             Top             =   240
  268.             Width           =   732
  269.          End
  270.          Begin VB.Label OptionDescription 
  271.             Height          =   252
  272.             Left            =   960
  273.             TabIndex        =   29
  274.             Top             =   240
  275.             Width           =   2292
  276.          End
  277.       End
  278.       Begin VB.Frame Frame4 
  279.          Caption         =   "PS &Position to Start Find"
  280.          Height          =   612
  281.          Left            =   2040
  282.          TabIndex        =   3
  283.          Top             =   120
  284.          Width           =   3372
  285.          Begin VB.Label RowColumnLabel 
  286.             Height          =   252
  287.             Left            =   720
  288.             TabIndex        =   31
  289.             Top             =   240
  290.             Width           =   2532
  291.          End
  292.       End
  293.    End
  294. End
  295. Attribute VB_Name = "FormFindField"
  296. Attribute VB_Creatable = False
  297. Attribute VB_Exposed = False
  298.  
  299. Private Function Display5250FieldInfo() As Integer
  300. On Error GoTo ErrHandler52
  301.    Dim Status As Integer
  302.    Status = True
  303.    
  304.    StartPos& = 1
  305.    EndPos& = 1
  306.    StringLength& = Len(FindFieldDataText.Text)
  307.       
  308.    If Left$(FindFieldDataText.Text, 9) = "Formatted" Then
  309.       For i% = 0 To 7
  310.          EndPos& = InStr(StartPos&, FindFieldDataText.Text, Chr$(9))
  311.          If (EndPos& = StartPos&) Or (EndPos& = 0) Then
  312.             Status = False
  313.             Exit For
  314.          End If
  315.          TempData(i%) = Mid$(FindFieldDataText.Text, StartPos&, EndPos& - StartPos&)
  316.          StartPos& = EndPos& + 1
  317.       Next i%
  318.       If (Status = True) And (StringLength& > StartPos&) Then
  319.          TempData(8) = Mid$(FindFieldDataText.Text, StartPos&, StringLength&)
  320.       Else
  321.          Status = False
  322.       End If
  323.  
  324.       If Status = True Then
  325.          FieldDataLabel1.Caption = TempData(0)
  326.  
  327.          FieldLabel2.Caption = "Field Attribute:"
  328.          If Val(TempData(1)) = 0 Then
  329.             FieldDataLabel2.Caption = "Not a field attribute byte"
  330.          ElseIf Val(TempData(1)) = 1 Then
  331.             FieldDataLabel2.Caption = "Field attribute byte"
  332.          End If
  333.  
  334.          FieldLabel3.Caption = "Visibility:"
  335.          If Val(TempData(2)) = 0 Then
  336.             FieldDataLabel3.Caption = "Non display"
  337.          ElseIf Val(TempData(2)) = 1 Then
  338.             FieldDataLabel3.Caption = "Display"
  339.          End If
  340.  
  341.          FieldLabel4.Caption = "Unprotected/Protected:"
  342.          If Val(TempData(3)) = 0 Then
  343.             FieldDataLabel4.Caption = "Unprotected data field"
  344.          ElseIf Val(TempData(3)) = 1 Then
  345.             FieldDataLabel4.Caption = "Protected data field"
  346.          End If
  347.  
  348.          FieldLabel5.Caption = "Intensity:"
  349.          If Val(TempData(4)) = 0 Then
  350.             FieldDataLabel5.Caption = "Normal"
  351.          ElseIf Val(TempData(4)) = 1 Then
  352.             FieldDataLabel5.Caption = "High"
  353.          End If
  354.  
  355.          FieldLabel6.Caption = "Field type:"
  356.          If Val(TempData(5)) = 0 Then
  357.             FieldDataLabel6.Caption = "Alphanumeric"
  358.          ElseIf Val(TempData(5)) = 1 Then
  359.             FieldDataLabel6.Caption = "Alphabetic only"
  360.          ElseIf Val(TempData(5)) = 2 Then
  361.             FieldDataLabel6.Caption = "Numeric shift"
  362.          ElseIf Val(TempData(5)) = 3 Then
  363.             FieldDataLabel6.Caption = "Numeric only"
  364.          ElseIf Val(TempData(5)) = 5 Then
  365.             FieldDataLabel6.Caption = "Digits only"
  366.          ElseIf Val(TempData(5)) = 6 Then
  367.             FieldDataLabel6.Caption = "Magnetic stripe reader data only"
  368.          ElseIf Val(TempData(5)) = 7 Then
  369.             FieldDataLabel6.Caption = "Signed numeric"
  370.          End If
  371.  
  372.          FieldLabel7.Caption = "MDT:"
  373.          If Val(TempData(6)) = 0 Then
  374.             FieldDataLabel7.Caption = "Field has not been modified"
  375.          ElseIf Val(TempData(6)) = 1 Then
  376.             FieldDataLabel7.Caption = "Field has been modified"
  377.          End If
  378.  
  379.          FieldLabel8.Caption = "Field start offset:"
  380.          FieldDataLabel8.Caption = TempData(7)
  381.          
  382.          FieldLabel9.Caption = "Field Length:"
  383.          FieldDataLabel9.Caption = TempData(8)
  384.       End If
  385.    Else
  386.       FieldDataLabel1.Caption = FindFieldDataText.Text
  387.    End If
  388.    
  389.    Display5250FieldInfo = Status
  390.    Exit Function
  391.  
  392. ErrHandler52:
  393.    Status = False
  394.    Resume Next
  395. End Function
  396.  
  397. Private Function DisplayFieldInfo() As Integer
  398. On Error GoTo ErrorHandler
  399.    Dim Status As Integer
  400.    Status = True
  401.    
  402.    StartPos& = 1
  403.    EndPos& = 1
  404.    StringLength& = Len(FindFieldDataText.Text)
  405.       
  406.    If Left$(FindFieldDataText.Text, 9) = "Formatted" Then
  407.       For i% = 0 To 5
  408.          EndPos& = InStr(StartPos&, FindFieldDataText.Text, Chr$(9))
  409.          If (EndPos& = StartPos&) Or (EndPos& = 0) Then
  410.             Status = False
  411.             Exit For
  412.          End If
  413.          TempData(i%) = Mid$(FindFieldDataText.Text, StartPos&, EndPos& - StartPos&)
  414.          StartPos& = EndPos& + 1
  415.       Next i%
  416.       If (Status = True) And (StringLength& > StartPos&) Then
  417.          TempData(6) = Mid$(FindFieldDataText.Text, StartPos&, StringLength&)
  418.       Else
  419.          Status = False
  420.       End If
  421.  
  422.       If Status = True Then
  423.          FieldDataLabel1.Caption = TempData(0)
  424.  
  425.          FieldLabel2.Caption = "Unprotected/Protected:"
  426.          If Val(TempData(1)) = 0 Then
  427.             FieldDataLabel2.Caption = "Unprotected data field"
  428.          ElseIf Val(TempData(1)) = 1 Then
  429.             FieldDataLabel2.Caption = "Protected data field"
  430.          End If
  431.  
  432.          FieldLabel3.Caption = "A/N:"
  433.          If Val(TempData(2)) = 0 Then
  434.             FieldDataLabel3.Caption = "Alphanumeric data"
  435.          ElseIf Val(TempData(2)) = 1 Then
  436.             FieldDataLabel3.Caption = "Numeric data"
  437.          End If
  438.  
  439.          FieldLabel4.Caption = "I/SPD:"
  440.          If Val(TempData(3)) = 0 Then
  441.             FieldDataLabel4.Caption = "Normal intensity, pen not detectable"
  442.          ElseIf Val(TempData(3)) = 1 Then
  443.             FieldDataLabel4.Caption = "Normal intensity, pen detectable"
  444.          ElseIf Val(TempData(3)) = 2 Then
  445.             FieldDataLabel4.Caption = "High intensity, pen detectable"
  446.          ElseIf Val(TempData(3)) = 3 Then
  447.             FieldDataLabel4.Caption = "Non display, pen not detectable"
  448.          End If
  449.          
  450.          FieldLabel5.Caption = "MDT:"
  451.          If Val(TempData(4)) = 0 Then
  452.             FieldDataLabel5.Caption = "Field has not been modified."
  453.          ElseIf Val(TempData(4)) = 1 Then
  454.             FieldDataLabel5.Caption = "Field has been modified."
  455.          End If
  456.          
  457.          FieldLabel6.Caption = "Field start offset:"
  458.          FieldDataLabel6.Caption = TempData(5)
  459.          
  460.          FieldLabel7.Caption = "Field length:"
  461.          FieldDataLabel7.Caption = TempData(6)
  462.          
  463.          FieldLabel8.Caption = ""
  464.          FieldDataLabel8.Caption = ""
  465.          
  466.          FieldLabel9.Caption = ""
  467.          FieldDataLabel9.Caption = ""
  468.       End If
  469.    Else
  470.       FieldDataLabel1.Caption = FindFieldDataText.Text
  471.    End If
  472.    
  473.    DisplayFieldInfo = Status
  474.    Exit Function
  475.  
  476. ErrorHandler:
  477.    Status = False
  478.    Resume Next
  479. End Function
  480.  
  481.  
  482. Private Sub Execute_Click()
  483.    Dim Status As Integer
  484. On Error GoTo ErrHandler
  485.    FunctionComp = True
  486.    
  487.    OldMousePointer = MousePointer
  488.    MousePointer = 11 ' Hour Glass Mouse Pointer
  489.    
  490.    ClearForm
  491.    DisplayType$ = GetDisplayType$(SessionIdList.Text)
  492.    
  493.    If DisplayType$ = "NONE" Then
  494.       MousePointer = OldMousePointer
  495.       MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
  496.       Exit Sub
  497.    End If
  498.    Topic$ = "Session" + SessionIdList.Text
  499.    Item$ = GetFindFieldItem()
  500.    
  501.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  502.                                 'DoEvents function each time before
  503.                                 'starting DDE conversation.
  504.  
  505.    FindFieldDataText.LinkTimeout = -1
  506.    FindFieldDataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
  507.    FindFieldDataText.LinkMode = COLD
  508.    FindFieldDataText.LinkItem = Item$
  509.    FindFieldDataText.LinkRequest
  510.    FindFieldDataText.LinkMode = NONE
  511.       
  512.    MousePointer = OldMousePointer
  513.    If FunctionComp = True Then
  514.       If DisplayType$ = "3270" Then
  515.          Status = DisplayFieldInfo()
  516.       Else
  517.          Status = Display5250FieldInfo()
  518.       End If
  519.       If Status = True Then
  520.          MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
  521.          EndStatus$ = MSG_OK
  522.       Else
  523.          MsgBox MSG_INVALID_DATA, 48, MSG_SAMPLE_PROG
  524.          EndStatus$ = MSG_NG
  525.       End If
  526.    Else
  527.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  528.       EndStatus$ = MSG_NG
  529.    End If
  530.    TempLogData$ = Time$ + ":Find Field : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  531.    TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  532.    TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  533.    TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  534.    TempLogData$ = TempLogData$ + "Data =" + """" + FindFieldDataText.Text + """" + Chr$(13) + Chr$(10)
  535.    LogData$(LogEnd) = TempLogData$
  536.    UpdateLogPointer
  537.    Loged = True
  538.    Exit Sub
  539.  
  540. ErrHandler:
  541.    FunctionComp = False
  542.    Resume Next
  543. End Sub
  544.  
  545. Private Sub ExitDlg_Click()
  546.     Hide
  547. End Sub
  548.  
  549. Private Sub FindStartPosOption_Change()
  550.   UpdateOptionDescription
  551. End Sub
  552.  
  553. Private Sub FindStartPosOption_Click()
  554.   UpdateOptionDescription
  555. End Sub
  556.  
  557.  
  558. Private Sub FindStartPosOption_KeyPress(KeyAscii As Integer)
  559.   KeyAscii = 0
  560. End Sub
  561.  
  562.  
  563. Private Sub FindStartPosText_Change()
  564.   CleanUpNumberText FindStartPosText
  565.  
  566.   UpdateRowColumnLabel
  567. End Sub
  568.  
  569. Private Sub FindStartPosText_LostFocus()
  570.   length = Len(FindStartPosText.Text)
  571.   If length < 4 Then
  572.     FindStartPosText.SelStart = 0
  573.     FindStartPosText.SelText = Mid("0000", 1, 4 - length)
  574.   End If
  575. End Sub
  576.  
  577.  
  578. Private Sub Form_Load()
  579.   SessionIdList.ListIndex = 0
  580.   FindStartPosOption.Text = """NU"""
  581.   FindStartPosText = "0000"
  582. End Sub
  583.  
  584. Private Function GetFindFieldItem() As String
  585.    Dim ReturnString As String
  586.  
  587.    ReturnString = "Field"
  588.    temp$ = RTrim$(LTrim$(FindStartPosText.Text))
  589.    Temp2$ = RTrim$(LTrim$(FindStartPosOption.Text))
  590.    If Len(Temp2$) = 0 Then
  591.      Temp2$ = """  """
  592.    End If
  593.    If Len(temp$) > 0 Then
  594.       ReturnString = ReturnString + "(" + temp$ + "," + Temp2$ + ")"
  595.    End If
  596.    GetFindFieldItem = ReturnString
  597. End Function
  598.  
  599. Private Sub UpdateLogPointer()
  600.     LogEnd = LogEnd + 1
  601.     If LogEnd = MAXLOGNUM + 1 Then
  602.        LogEnd = 0
  603.     End If
  604.  
  605.     If LogTop = LogEnd Then
  606.        LogTop = LogTop + 1
  607.        If LogTop = MAXLOGNUM + 1 Then
  608.           LogTop = 0
  609.        End If
  610.     End If
  611. End Sub
  612.  
  613.  
  614.  
  615.  
  616. Private Sub ClearForm()
  617.  
  618.          FieldDataLabel1.Caption = ""
  619.          
  620.          FieldLabel2.Caption = ""
  621.          FieldDataLabel2.Caption = ""
  622.          
  623.          FieldLabel3.Caption = ""
  624.          FieldDataLabel3.Caption = ""
  625.          
  626.          FieldLabel4.Caption = ""
  627.          FieldDataLabel4.Caption = ""
  628.          
  629.          FieldLabel5.Caption = ""
  630.          FieldDataLabel5.Caption = ""
  631.          
  632.          FieldLabel6.Caption = ""
  633.          FieldDataLabel6.Caption = ""
  634.          
  635.          FieldLabel7.Caption = ""
  636.          FieldDataLabel7.Caption = ""
  637.          
  638.          FieldLabel8.Caption = ""
  639.          FieldDataLabel8.Caption = ""
  640.          
  641.          FieldLabel9.Caption = ""
  642.          FieldDataLabel9.Caption = ""
  643.  
  644. End Sub
  645.  
  646.  
  647. Private Sub UpdateOptionDescription()
  648.   If FindStartPosOption.Text = """  """ Then
  649.     OptionDescription.Caption = "Field at Position"
  650.   ElseIf FindStartPosOption.Text = """T """ Then
  651.     OptionDescription.Caption = "Field at Position"
  652.   ElseIf FindStartPosOption.Text = """P """ Then
  653.     OptionDescription.Caption = "Previous Field"
  654.   ElseIf FindStartPosOption.Text = """N """ Then
  655.     OptionDescription.Caption = "Next Field"
  656.   ElseIf FindStartPosOption.Text = """NP""" Then
  657.     OptionDescription.Caption = "Next Protected Field"
  658.   ElseIf FindStartPosOption.Text = """NU""" Then
  659.     OptionDescription.Caption = "Next Unprotected Field"
  660.   ElseIf FindStartPosOption.Text = """PP""" Then
  661.     OptionDescription.Caption = "Previous Protected Field"
  662.   ElseIf FindStartPosOption.Text = """PU""" Then
  663.     OptionDescription.Caption = "Previous Unprotected Field"
  664.   Else
  665.     OptionDescription.Caption = "Error: Unknown"
  666.   End If
  667. End Sub
  668.  
  669. Private Sub SessionIdList_Change()
  670.   UpdateSessionTypeLabel
  671.   UpdateRowColumnLabel
  672. End Sub
  673.  
  674.  
  675. Private Sub SessionIdList_Click()
  676.   UpdateSessionTypeLabel
  677.   UpdateRowColumnLabel
  678. End Sub
  679.  
  680.  
  681.  
  682. Private Sub UpdateSessionTypeLabel()
  683.   SessionType$ = GetDisplayType(SessionIdList.Text)
  684.   If SessionType$ = "NONE" Then
  685.     SessionTypeLabel.Caption = ""
  686.   Else
  687.     SessionTypeLabel.Caption = SessionType$ & " Session"
  688.   End If
  689. End Sub
  690.  
  691. Private Sub UpdateRowColumnLabel()
  692.   Dim Width As Integer
  693.   Dim Height As Integer
  694.   Dim Column As Integer
  695.   Dim Row As Integer
  696.   
  697.   If FindStartPosText.Text = "" Then
  698.     RowColumnLabel.Caption = ""
  699.   Else
  700.     GetSessionDimensions SessionIdList.Text, Width, Height
  701.     If Width <> 0 Then
  702.       Column = (CInt(FindStartPosText.Text) Mod Width) + 1
  703.       Row = (CInt(FindStartPosText.Text) / Width) + 1
  704.       RowColumnLabel.Caption = "Row: " & Row & " Coulmn: " & Column
  705.     Else
  706.       RowColumnLabel.Caption = ""
  707.     End If
  708.   End If
  709. End Sub
  710.