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

  1. VERSION 4.00
  2. Begin VB.Form FormGetPartialPS 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Get Partial Presentation Space"
  5.    ClientHeight    =   6420
  6.    ClientLeft      =   1500
  7.    ClientTop       =   825
  8.    ClientWidth     =   8055
  9.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  10.       Name            =   "MS Sans Serif"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   700
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   6825
  20.    Left            =   1440
  21.    LinkMode        =   1  'Source
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   6420
  26.    ScaleWidth      =   8055
  27.    ShowInTaskbar   =   0   'False
  28.    Top             =   480
  29.    Width           =   8175
  30.    Begin VB.TextBox PartialPSDataText 
  31.       BackColor       =   &H00C0FFFF&
  32.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.          Name            =   "System"
  34.          Size            =   13.5
  35.          Charset         =   128
  36.          Weight          =   700
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       ForeColor       =   &H00FF0000&
  42.       Height          =   405
  43.       Left            =   3840
  44.       Locked          =   -1  'True
  45.       MultiLine       =   -1  'True
  46.       TabIndex        =   2
  47.       TabStop         =   0   'False
  48.       Top             =   5760
  49.       Visible         =   0   'False
  50.       Width           =   396
  51.    End
  52.    Begin VB.CommandButton ExitDlg 
  53.       Cancel          =   -1  'True
  54.       Caption         =   "E&xit"
  55.       Height          =   372
  56.       Left            =   5040
  57.       TabIndex        =   1
  58.       Top             =   5760
  59.       Width           =   972
  60.    End
  61.    Begin VB.CommandButton Execute 
  62.       Caption         =   "&Execute"
  63.       Default         =   -1  'True
  64.       Height          =   375
  65.       Left            =   2040
  66.       TabIndex        =   0
  67.       Top             =   5760
  68.       Width           =   975
  69.    End
  70.    Begin TabDlg.SSTab SSTab1 
  71.       Height          =   5535
  72.       Left            =   120
  73.       TabIndex        =   3
  74.       Top             =   120
  75.       Width           =   7815
  76.       _ExtentX        =   13785
  77.       _ExtentY        =   9763
  78.       _Version        =   393216
  79.       Tab             =   2
  80.       TabHeight       =   423
  81.       TabCaption(0)   =   "Input Parameters"
  82.       Tab(0).ControlEnabled=   0   'False
  83.       Tab(0).Control(0)=   "Frame1"
  84.       Tab(0).ControlCount=   1
  85.       TabCaption(1)   =   "PS Info and Data"
  86.       Tab(1).ControlEnabled=   0   'False
  87.       Tab(1).Control(0)=   "Frame6"
  88.       Tab(1).Control(1)=   "Frame5"
  89.       Tab(1).Control(2)=   "Frame4"
  90.       Tab(1).Control(3)=   "Frame3"
  91.       Tab(1).Control(4)=   "Frame7"
  92.       Tab(1).ControlCount=   5
  93.       TabCaption(2)   =   "Field Info"
  94.       Tab(2).ControlEnabled=   -1  'True
  95.       Tab(2).Control(0)=   "Frame8"
  96.       Tab(2).Control(0).Enabled=   0   'False
  97.       Tab(2).ControlCount=   1
  98.       Begin VB.Frame Frame7 
  99.          Caption         =   "Partial PS Data"
  100.          Height          =   4332
  101.          Left            =   -74880
  102.          TabIndex        =   38
  103.          Top             =   1080
  104.          Width           =   7572
  105.          Begin VB.TextBox PSDataText 
  106.             BackColor       =   &H00C0FFFF&
  107.             BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  108.                Name            =   "IBM3270"
  109.                Size            =   10.5
  110.                Charset         =   0
  111.                Weight          =   400
  112.                Underline       =   0   'False
  113.                Italic          =   0   'False
  114.                Strikethrough   =   0   'False
  115.             EndProperty
  116.             Height          =   3972
  117.             Left            =   120
  118.             Locked          =   -1  'True
  119.             MultiLine       =   -1  'True
  120.             ScrollBars      =   3  'Both
  121.             TabIndex        =   39
  122.             Top             =   240
  123.             Width           =   7332
  124.          End
  125.       End
  126.       Begin VB.Frame Frame3 
  127.          Caption         =   "Beginning Position"
  128.          Height          =   612
  129.          Left            =   -74880
  130.          TabIndex        =   36
  131.          Top             =   360
  132.          Width           =   1812
  133.          Begin VB.Label BeginLabel 
  134.             Alignment       =   2  'Center
  135.             Height          =   252
  136.             Left            =   120
  137.             TabIndex        =   37
  138.             Top             =   240
  139.             Width           =   1572
  140.          End
  141.       End
  142.       Begin VB.Frame Frame4 
  143.          Caption         =   "Length of Data"
  144.          Height          =   612
  145.          Left            =   -72960
  146.          TabIndex        =   34
  147.          Top             =   360
  148.          Width           =   1812
  149.          Begin VB.Label LengthLabel 
  150.             Alignment       =   2  'Center
  151.             Height          =   252
  152.             Left            =   120
  153.             TabIndex        =   35
  154.             Top             =   240
  155.             Width           =   1572
  156.          End
  157.       End
  158.       Begin VB.Frame Frame5 
  159.          Caption         =   "Number of Rows"
  160.          Height          =   612
  161.          Left            =   -71040
  162.          TabIndex        =   32
  163.          Top             =   360
  164.          Width           =   1812
  165.          Begin VB.Label RowsLabel 
  166.             Alignment       =   2  'Center
  167.             Height          =   252
  168.             Left            =   120
  169.             TabIndex        =   33
  170.             Top             =   240
  171.             Width           =   1572
  172.          End
  173.       End
  174.       Begin VB.Frame Frame6 
  175.          Caption         =   "Number of Columns"
  176.          Height          =   612
  177.          Left            =   -69120
  178.          TabIndex        =   30
  179.          Top             =   360
  180.          Width           =   1812
  181.          Begin VB.Label ColumnsLabel 
  182.             Alignment       =   2  'Center
  183.             Height          =   252
  184.             Left            =   120
  185.             TabIndex        =   31
  186.             Top             =   240
  187.             Width           =   1572
  188.          End
  189.       End
  190.       Begin VB.Frame Frame8 
  191.          Caption         =   "Field Information"
  192.          Height          =   3852
  193.          Left            =   840
  194.          TabIndex        =   12
  195.          Top             =   960
  196.          Width           =   6132
  197.          Begin VB.Frame Frame10 
  198.             Caption         =   "Fields"
  199.             Height          =   2532
  200.             Left            =   240
  201.             TabIndex        =   15
  202.             Top             =   1080
  203.             Width           =   5652
  204.             Begin VB.Frame Frame16 
  205.                Caption         =   "Is Protected"
  206.                Height          =   612
  207.                Left            =   3840
  208.                TabIndex        =   27
  209.                Top             =   1680
  210.                Width           =   1572
  211.                Begin VB.Label IsProtectedLabel 
  212.                   Alignment       =   2  'Center
  213.                   Height          =   252
  214.                   Left            =   120
  215.                   TabIndex        =   28
  216.                   Top             =   240
  217.                   Width           =   1332
  218.                End
  219.             End
  220.             Begin VB.ComboBox FieldCombo 
  221.                BackColor       =   &H00C0FFFF&
  222.                ForeColor       =   &H00000000&
  223.                Height          =   315
  224.                ItemData        =   "FGPARTPS.frx":0000
  225.                Left            =   600
  226.                List            =   "FGPARTPS.frx":0002
  227.                Style           =   2  'Dropdown List
  228.                TabIndex        =   26
  229.                Top             =   360
  230.                Width           =   855
  231.             End
  232.             Begin VB.Frame Frame15 
  233.                Caption         =   "Is Modified"
  234.                Height          =   612
  235.                Left            =   2040
  236.                TabIndex        =   24
  237.                Top             =   1680
  238.                Width           =   1572
  239.                Begin VB.Label IsModifiedLabel 
  240.                   Alignment       =   2  'Center
  241.                   Height          =   252
  242.                   Left            =   120
  243.                   TabIndex        =   25
  244.                   Top             =   240
  245.                   Width           =   1332
  246.                End
  247.             End
  248.             Begin VB.Frame Frame14 
  249.                Caption         =   "Pen Detectable"
  250.                Height          =   612
  251.                Left            =   240
  252.                TabIndex        =   22
  253.                Top             =   1680
  254.                Width           =   1572
  255.                Begin VB.Label PenDectionLabel 
  256.                   Alignment       =   2  'Center
  257.                   Height          =   252
  258.                   Left            =   120
  259.                   TabIndex        =   23
  260.                   Top             =   240
  261.                   Width           =   1332
  262.                End
  263.             End
  264.             Begin VB.Frame Frame13 
  265.                Caption         =   "Intensity"
  266.                Height          =   612
  267.                Left            =   3840
  268.                TabIndex        =   20
  269.                Top             =   840
  270.                Width           =   1572
  271.                Begin VB.Label IntensityLabel 
  272.                   Alignment       =   2  'Center
  273.                   Height          =   252
  274.                   Left            =   120
  275.                   TabIndex        =   21
  276.                   Top             =   240
  277.                   Width           =   1332
  278.                End
  279.             End
  280.             Begin VB.Frame Frame12 
  281.                Caption         =   "Type of Data"
  282.                Height          =   612
  283.                Left            =   2040
  284.                TabIndex        =   18
  285.                Top             =   840
  286.                Width           =   1572
  287.                Begin VB.Label TypeOfDataLabel 
  288.                   Alignment       =   2  'Center
  289.                   Height          =   252
  290.                   Left            =   120
  291.                   TabIndex        =   19
  292.                   Top             =   240
  293.                   Width           =   1332
  294.                End
  295.             End
  296.             Begin VB.Frame Frame11 
  297.                Caption         =   "Field Range"
  298.                Height          =   612
  299.                Left            =   240
  300.                TabIndex        =   16
  301.                Top             =   840
  302.                Width           =   1572
  303.                Begin VB.Label FieldRangeLabel 
  304.                   Alignment       =   2  'Center
  305.                   Height          =   252
  306.                   Left            =   120
  307.                   TabIndex        =   17
  308.                   Top             =   240
  309.                   Width           =   1332
  310.                End
  311.             End
  312.             Begin VB.Label Label8 
  313.                Caption         =   "Field"
  314.                Height          =   252
  315.                Left            =   120
  316.                TabIndex        =   29
  317.                Top             =   360
  318.                Width           =   492
  319.             End
  320.          End
  321.          Begin VB.Frame Frame9 
  322.             Caption         =   "Number of Fields"
  323.             Height          =   612
  324.             Left            =   240
  325.             TabIndex        =   13
  326.             Top             =   360
  327.             Width           =   1812
  328.             Begin VB.Label NumberLabel 
  329.                Alignment       =   2  'Center
  330.                Height          =   252
  331.                Left            =   120
  332.                TabIndex        =   14
  333.                Top             =   240
  334.                Width           =   1572
  335.             End
  336.          End
  337.       End
  338.       Begin VB.Frame Frame1 
  339.          Caption         =   "Input Parameters"
  340.          ForeColor       =   &H80000008&
  341.          Height          =   612
  342.          Left            =   -74760
  343.          TabIndex        =   4
  344.          Top             =   840
  345.          Width           =   7332
  346.          Begin VB.TextBox PSFirstPositionText 
  347.             BackColor       =   &H00FFFFC0&
  348.             ForeColor       =   &H00000000&
  349.             Height          =   285
  350.             Left            =   3480
  351.             MaxLength       =   4
  352.             TabIndex        =   8
  353.             Text            =   "0000"
  354.             Top             =   240
  355.             Width           =   615
  356.          End
  357.          Begin VB.TextBox DataLengthText 
  358.             BackColor       =   &H00FFFFC0&
  359.             ForeColor       =   &H00000000&
  360.             Height          =   285
  361.             Left            =   5400
  362.             MaxLength       =   4
  363.             TabIndex        =   7
  364.             Text            =   "1920"
  365.             Top             =   240
  366.             Width           =   615
  367.          End
  368.          Begin VB.CheckBox EOFflag 
  369.             Caption         =   "EO&F flag"
  370.             ForeColor       =   &H80000008&
  371.             Height          =   252
  372.             Left            =   6120
  373.             TabIndex        =   6
  374.             Top             =   240
  375.             Width           =   1092
  376.          End
  377.          Begin VB.ComboBox SessionIdList 
  378.             BackColor       =   &H00FFFFC0&
  379.             ForeColor       =   &H00000000&
  380.             Height          =   288
  381.             ItemData        =   "FGPARTPS.frx":0004
  382.             Left            =   1200
  383.             List            =   "FGPARTPS.frx":0056
  384.             Sorted          =   -1  'True
  385.             Style           =   2  'Dropdown List
  386.             TabIndex        =   5
  387.             Top             =   240
  388.             Width           =   492
  389.          End
  390.          Begin VB.Label Label2 
  391.             Caption         =   "PS First &Position"
  392.             ForeColor       =   &H80000008&
  393.             Height          =   252
  394.             Left            =   2040
  395.             TabIndex        =   11
  396.             Top             =   240
  397.             Width           =   1452
  398.          End
  399.          Begin VB.Label DataLengthLabel 
  400.             Caption         =   "Data &Length"
  401.             ForeColor       =   &H80000008&
  402.             Height          =   252
  403.             Left            =   4200
  404.             TabIndex        =   10
  405.             Top             =   240
  406.             Width           =   1212
  407.          End
  408.          Begin VB.Label Label4 
  409.             Caption         =   "Session &Id"
  410.             Height          =   252
  411.             Left            =   240
  412.             TabIndex        =   9
  413.             Top             =   240
  414.             Width           =   972
  415.          End
  416.       End
  417.    End
  418. End
  419. Attribute VB_Name = "FormGetPartialPS"
  420. Attribute VB_Creatable = False
  421. Attribute VB_Exposed = False
  422.  ' Should dynamically base these off of the number of fields.
  423.  Dim FieldStarts(0 To 1000) As String
  424.  Dim FieldLengths(0 To 1000) As String
  425.  Dim FieldAttributes(0 To 1000) As String
  426.  
  427. Private Sub DataLengthText_Change()
  428.   CleanUpNumberText DataLengthText
  429. End Sub
  430.  
  431.  
  432. Private Sub EOFflag_Click()
  433.  
  434.    If EOFflag.Value = UNCHECKED Then
  435.       DataLengthText.Enabled = True
  436.       DataLengthLabel.Enabled = True
  437.    Else
  438.       DataLengthText.Enabled = False
  439.       DataLengthLabel.Enabled = False
  440.    End If
  441.  
  442. End Sub
  443.  
  444. Private Sub Execute_Click()
  445. On Error GoTo ErrHandler
  446.    FunctionComp = True
  447.  
  448.    OldMousePointer = MousePointer
  449.    MousePointer = 11 ' Hour Glass Mouse Pointer
  450.    
  451.    DisplayType$ = GetDisplayType$(SessionIdList.Text)
  452.    
  453.    If DisplayType$ = "NONE" Then
  454.       MousePointer = OldMousePointer
  455.       MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
  456.       Exit Sub
  457.    End If
  458.  
  459.    temp$ = LTrim$(RTrim$(SessionIdList.Text))
  460.    If Len(temp$) > 0 Then
  461.       Topic$ = "Session" + temp$
  462.    Else
  463.       MousePointer = OldMousePointer
  464.       MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  465.       Exit Sub
  466.    End If
  467.    Item$ = GetPartPSItem()
  468.    
  469.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  470.                                 'DoEvents function each time before
  471.                                 'starting DDE conversation.
  472.    
  473.    PartialPSDataText.LinkTimeout = -1
  474.    PartialPSDataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
  475.    PartialPSDataText.LinkMode = COLD
  476.    PartialPSDataText.LinkItem = Item$
  477.    PartialPSDataText.LinkRequest
  478.    PartialPSDataText.LinkMode = NONE
  479.    
  480.    MousePointer = OldMousePointer
  481.    If FunctionComp = True Then
  482.       GetPartialPSInfo
  483.       If CInt(NumberLabel.Caption) <> 0 Then
  484.         FieldCombo.ListIndex = 0
  485.       End If
  486.       SSTab1.Tab = 1
  487.       MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
  488.       EndStatus$ = MSG_OK
  489.    Else
  490.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  491.       EndStatus$ = MSG_NG
  492.    End If
  493.    TempLogData$ = Time$ + ":Get Partial PS : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  494.    TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  495.    TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  496.    TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10)
  497.    LogData$(LogEnd) = TempLogData$
  498.    UpdateLogPointer
  499.    Loged = True
  500.    Exit Sub
  501.  
  502. ErrHandler:
  503.    FunctionComp = False
  504.    Resume Next
  505. End Sub
  506.  
  507. Private Sub ExitDlg_Click()
  508.     Hide
  509. End Sub
  510.  
  511. Private Function GetPartPSItem() As String
  512.    temp$ = RTrim$(LTrim$(PSFirstPositionText.Text))
  513.    Temp2$ = RTrim$(LTrim$(DataLengthText.Text))
  514.    If EOFflag.Value = CHECKED Then
  515.       Temp3$ = "1"
  516.    Else
  517.       Temp3$ = "0"
  518.    End If
  519.    
  520.    GetPartPSItem = "EPS" + "(" + temp$ + "," + Temp2$ + "," + Temp3$ + ")"
  521. End Function
  522.  
  523. Private Sub UpdateLogPointer()
  524.     LogEnd = LogEnd + 1
  525.     If LogEnd = MAXLOGNUM + 1 Then
  526.        LogEnd = 0
  527.     End If
  528.  
  529.     If LogTop = LogEnd Then
  530.        LogTop = LogTop + 1
  531.        If LogTop = MAXLOGNUM + 1 Then
  532.           LogTop = 0
  533.        End If
  534.     End If
  535. End Sub
  536.  
  537. Private Sub FieldCombo_Change()
  538.  Dim FieldAttribute As Byte
  539.  
  540. MsgBox "1"
  541.  StartOfField = FieldStarts(FieldCombo.Text)
  542. MsgBox "2"
  543.  length = FieldLengths(FieldCombo.Text)
  544. MsgBox "3"
  545.  EndOfField = StartOfField + length - 1
  546. MsgBox "4"
  547.  FieldAttribute = FieldAttributes(FieldCombo.Text)
  548. MsgBox "5"
  549.   
  550.  FieldRangeLabel.Caption = StartOfField & "-" & EndOfField
  551.   
  552.   If FieldAttribute Or &H10& Then
  553.    TypeOfDataLabel.Caption = "Numeric"
  554.  Else
  555.    TypeOfDataLabel.Caption = "AlphaNumeric"
  556.  End If
  557.  
  558.  If FieldAttribute Or &H20& Then
  559.    IsProtectedLabel.Caption = "Yes"
  560.  Else
  561.    IsProtectedLabel.Caption = "No"
  562.  End If
  563.  
  564.  If ((FieldAttribute Or &HC&) = &H0&) Then
  565.    IntensityLabel.Caption = "Normal"
  566.    PenDectionLabel.Caption = "No"
  567.  ElseIf ((FieldAttribute Or &HC&) = &H4&) Then
  568.    IntensityLabel.Caption = "Normal"
  569.    PenDectionLabel.Caption = "Yes"
  570.  ElseIf ((FieldAttribute Or &HC&) = &H8&) Then
  571.    IntensityLabel.Caption = "High"
  572.    PenDectionLabel.Caption = "Yes"
  573.  Else
  574.    IntensityLabel.Caption = "Non-Display"
  575.    PenDectionLabel.Caption = "No"
  576.  End If
  577.  
  578.  If FieldAttribute Or &H1& Then
  579.    IsModifiedLabel.Caption = "Yes"
  580.  Else
  581.    IsModifiedLabel.Caption = "No"
  582.  End If
  583.  
  584. End Sub
  585.  
  586. Private Sub FieldCombo_Click()
  587.  Dim FieldAttribute As Byte
  588.  Dim StartOfField As Integer
  589.  Dim length As Integer
  590.  Dim EndOfField As Integer
  591.  
  592.  StartOfField = FieldStarts(FieldCombo.Text)
  593.  length = FieldLengths(FieldCombo.Text)
  594.  EndOfField = StartOfField + length - 1
  595.  'MFWU change Asc to be AscB
  596.  FieldAttribute = AscB(FieldAttributes(FieldCombo.Text))
  597.   
  598.  FieldRangeLabel.Caption = StartOfField & "-" & EndOfField
  599.   
  600.   If FieldAttribute And &H10& Then
  601.    TypeOfDataLabel.Caption = "Numeric"
  602.  Else
  603.    TypeOfDataLabel.Caption = "AlphaNumeric"
  604.  End If
  605.  
  606.  If FieldAttribute And &H20& Then
  607.    IsProtectedLabel.Caption = "Yes"
  608.  Else
  609.    IsProtectedLabel.Caption = "No"
  610.  End If
  611.  
  612.  If ((FieldAttribute And &HC&) = &H0&) Then
  613.    IntensityLabel.Caption = "Normal"
  614.    PenDectionLabel.Caption = "No"
  615.  ElseIf ((FieldAttribute And &HC&) = &H4&) Then
  616.    IntensityLabel.Caption = "Normal"
  617.    PenDectionLabel.Caption = "Yes"
  618.  ElseIf ((FieldAttribute And &HC&) = &H8&) Then
  619.    IntensityLabel.Caption = "High"
  620.    PenDectionLabel.Caption = "Yes"
  621.  Else
  622.    IntensityLabel.Caption = "Non-Display"
  623.    PenDectionLabel.Caption = "No"
  624.  End If
  625.  
  626.  If FieldAttribute And &H1& Then
  627.    IsModifiedLabel.Caption = "Yes"
  628.  Else
  629.    IsModifiedLabel.Caption = "No"
  630.  End If
  631.  
  632.  
  633. End Sub
  634.  
  635.  
  636. Private Sub Form_Load()
  637.   SessionIdList.ListIndex = 0
  638. End Sub
  639.  
  640.  
  641. Private Sub PSFirstPositionText_Change()
  642.   CleanUpNumberText PSFirstPositionText
  643. End Sub
  644.  
  645.  
  646.  
  647. Private Sub GetPartialPSInfo()
  648.   Dim BeginPosition As Integer
  649.   Dim EndPosition As Integer
  650.   
  651.   BeginPosition = 1
  652.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  653.   BeginLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  654.   
  655.   BeginPosition = EndPosition + 1
  656.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  657.   LengthLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  658.   
  659.   BeginPosition = EndPosition + 1
  660.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  661.   RowsLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  662.   
  663.   BeginPosition = EndPosition + 1
  664.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  665.   ColumnsLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  666.   
  667.   BeginPosition = EndPosition + 1
  668.   PSDataText.Text = Mid(PartialPSDataText.Text, BeginPosition, CInt(LengthLabel.Caption))
  669.   
  670.   BeginPosition = BeginPosition + CInt(LengthLabel.Caption) + 1 + 2 * (CInt(RowsLabel.Caption) - 1)
  671.                         ' +1 for Tab Character and + 1 for each newline character between each row
  672.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  673.   NumberLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  674.   
  675.   FieldCombo.Clear
  676.   FieldRangeLabel.Caption = ""
  677.   TypeOfDataLabel.Caption = ""
  678.   IntensityLabel.Caption = ""
  679.   PenDectionLabel.Caption = ""
  680.   IsModifiedLabel.Caption = ""
  681.   
  682.   If CInt(NumberLabel.Caption) <> 0 Then
  683.   For Counter = 1 To CInt(NumberLabel.Caption)
  684.     ' Field Start
  685.     BeginPosition = EndPosition + 1
  686.     BeginFieldPosition = BeginPosition
  687.     EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  688.     FieldStarts(Counter) = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  689.     
  690.     ' Field Length
  691.     BeginPosition = EndPosition + 1
  692.     EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  693.     FieldLengths(Counter) = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  694.     
  695.     ' Field Attribute
  696.     BeginPosition = EndPosition + 1
  697.     'MFWU change the following line
  698.     'EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  699.     EndPosition = BeginPosition + 1
  700. If EndPosition = 0 Then
  701.   MsgBox "EndPostion is 0"
  702. End If
  703.     'MFWU change Mid to be MidB
  704.     FieldAttributes(Counter) = MidB(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  705.     
  706.     FieldCombo.AddItem Counter
  707.   Next Counter
  708.   End If
  709. End Sub
  710.  
  711.