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

  1. VERSION 4.00
  2. Begin VB.Form FormStartPSAdvise 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Start Session Advise (PS)"
  5.    ClientHeight    =   6492
  6.    ClientLeft      =   1980
  7.    ClientTop       =   1536
  8.    ClientWidth     =   8772
  9.    ControlBox      =   0   'False
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   7.8
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   6816
  21.    Left            =   1932
  22.    LinkMode        =   1  'Source
  23.    LinkTopic       =   "Form2"
  24.    MaxButton       =   0   'False
  25.    MinButton       =   0   'False
  26.    ScaleHeight     =   6492
  27.    ScaleWidth      =   8772
  28.    ShowInTaskbar   =   0   'False
  29.    Top             =   1260
  30.    Width           =   8868
  31.    Begin VB.TextBox PartialPSDataText 
  32.       BackColor       =   &H00C0FFFF&
  33.       BeginProperty Font 
  34.          name            =   "System"
  35.          charset         =   0
  36.          weight          =   700
  37.          size            =   9.6
  38.          underline       =   0   'False
  39.          italic          =   0   'False
  40.          strikethrough   =   0   'False
  41.       EndProperty
  42.       ForeColor       =   &H00FF0000&
  43.       Height          =   372
  44.       Left            =   3360
  45.       Locked          =   -1  'True
  46.       MultiLine       =   -1  'True
  47.       TabIndex        =   4
  48.       TabStop         =   0   'False
  49.       Top             =   6000
  50.       Visible         =   0   'False
  51.       Width           =   396
  52.    End
  53.    Begin VB.CommandButton ExitCommand 
  54.       Cancel          =   -1  'True
  55.       Caption         =   "E&xit"
  56.       Height          =   372
  57.       Left            =   5760
  58.       TabIndex        =   3
  59.       Top             =   6000
  60.       Width           =   852
  61.    End
  62.    Begin VB.CommandButton StopCommand 
  63.       Caption         =   "&End"
  64.       Enabled         =   0   'False
  65.       Height          =   372
  66.       Left            =   3960
  67.       TabIndex        =   1
  68.       Top             =   6000
  69.       Width           =   852
  70.    End
  71.    Begin VB.CommandButton StartCommand 
  72.       Caption         =   "&Begin"
  73.       Default         =   -1  'True
  74.       Height          =   372
  75.       Left            =   2160
  76.       TabIndex        =   0
  77.       Top             =   6000
  78.       Width           =   852
  79.    End
  80.    Begin TabDlg.SSTab SSTab1 
  81.       Height          =   5532
  82.       Left            =   120
  83.       TabIndex        =   5
  84.       Top             =   120
  85.       Width           =   8532
  86.       _Version        =   65536
  87.       _ExtentX        =   15050
  88.       _ExtentY        =   9758
  89.       _StockProps     =   15
  90.       Caption         =   "PS Info and Data"
  91.       TabsPerRow      =   3
  92.       Tab             =   1
  93.       TabOrientation  =   0
  94.       Tabs            =   3
  95.       Style           =   0
  96.       TabMaxWidth     =   0
  97.       TabHeight       =   423
  98.       TabCaption(0)   =   "Input Parametrs"
  99.       Tab(0).ControlCount=   1
  100.       Tab(0).ControlEnabled=   0   'False
  101.       Tab(0).Control(0)=   "Frame1"
  102.       TabCaption(1)   =   "PS Info and Data"
  103.       Tab(1).ControlCount=   1
  104.       Tab(1).ControlEnabled=   -1  'True
  105.       Tab(1).Control(0)=   "PSInfoFrame"
  106.       TabCaption(2)   =   "Field Info"
  107.       Tab(2).ControlCount=   1
  108.       Tab(2).ControlEnabled=   0   'False
  109.       Tab(2).Control(0)=   "Frame8"
  110.       Begin VB.Frame Frame8 
  111.          Caption         =   "Field Information"
  112.          Height          =   3372
  113.          Left            =   -73560
  114.          TabIndex        =   32
  115.          Top             =   1320
  116.          Width           =   5652
  117.          Begin VB.ComboBox FieldCombo 
  118.             BackColor       =   &H00C0FFFF&
  119.             ForeColor       =   &H00000000&
  120.             Height          =   288
  121.             ItemData        =   "FSTPSAD.frx":0000
  122.             Left            =   120
  123.             List            =   "FSTPSAD.frx":0002
  124.             Style           =   2  'Dropdown List
  125.             TabIndex        =   46
  126.             Top             =   600
  127.             Width           =   492
  128.          End
  129.          Begin VB.Frame Frame10 
  130.             Caption         =   "Field"
  131.             Height          =   1932
  132.             Left            =   120
  133.             TabIndex        =   33
  134.             Top             =   1080
  135.             Width           =   5292
  136.             Begin VB.Frame Frame16 
  137.                Caption         =   "Is Protected"
  138.                Height          =   612
  139.                Left            =   1800
  140.                TabIndex        =   44
  141.                Top             =   1080
  142.                Width           =   1572
  143.                Begin VB.Label IsProtectedLabel 
  144.                   Alignment       =   2  'Center
  145.                   Height          =   252
  146.                   Left            =   120
  147.                   TabIndex        =   45
  148.                   Top             =   240
  149.                   Width           =   1332
  150.                End
  151.             End
  152.             Begin VB.Frame Frame15 
  153.                Caption         =   "Is Modified"
  154.                Height          =   612
  155.                Left            =   120
  156.                TabIndex        =   42
  157.                Top             =   1080
  158.                Width           =   1572
  159.                Begin VB.Label IsModifiedLabel 
  160.                   Alignment       =   2  'Center
  161.                   Height          =   252
  162.                   Left            =   120
  163.                   TabIndex        =   43
  164.                   Top             =   240
  165.                   Width           =   1332
  166.                End
  167.             End
  168.             Begin VB.Frame Frame14 
  169.                Caption         =   "Pen Detectable"
  170.                Height          =   612
  171.                Left            =   3480
  172.                TabIndex        =   40
  173.                Top             =   1080
  174.                Width           =   1572
  175.                Begin VB.Label PenDectionLabel 
  176.                   Alignment       =   2  'Center
  177.                   Height          =   252
  178.                   Left            =   120
  179.                   TabIndex        =   41
  180.                   Top             =   240
  181.                   Width           =   1332
  182.                End
  183.             End
  184.             Begin VB.Frame Frame13 
  185.                Caption         =   "Intensity"
  186.                Height          =   612
  187.                Left            =   3480
  188.                TabIndex        =   38
  189.                Top             =   240
  190.                Width           =   1572
  191.                Begin VB.Label IntensityLabel 
  192.                   Alignment       =   2  'Center
  193.                   Height          =   252
  194.                   Left            =   120
  195.                   TabIndex        =   39
  196.                   Top             =   240
  197.                   Width           =   1332
  198.                End
  199.             End
  200.             Begin VB.Frame Frame12 
  201.                Caption         =   "Type of Data"
  202.                Height          =   612
  203.                Left            =   1800
  204.                TabIndex        =   36
  205.                Top             =   240
  206.                Width           =   1572
  207.                Begin VB.Label TypeOfDataLabel 
  208.                   Alignment       =   2  'Center
  209.                   Height          =   252
  210.                   Left            =   120
  211.                   TabIndex        =   37
  212.                   Top             =   240
  213.                   Width           =   1332
  214.                End
  215.             End
  216.             Begin VB.Frame Frame11 
  217.                Caption         =   "Field Range"
  218.                Height          =   612
  219.                Left            =   120
  220.                TabIndex        =   34
  221.                Top             =   240
  222.                Width           =   1572
  223.                Begin VB.Label FieldRangeLabel 
  224.                   Alignment       =   2  'Center
  225.                   Height          =   252
  226.                   Left            =   120
  227.                   TabIndex        =   35
  228.                   Top             =   240
  229.                   Width           =   1332
  230.                End
  231.             End
  232.          End
  233.          Begin VB.Label Label8 
  234.             Caption         =   "Field"
  235.             Height          =   252
  236.             Left            =   120
  237.             TabIndex        =   47
  238.             Top             =   360
  239.             Width           =   492
  240.          End
  241.       End
  242.       Begin VB.Frame PSInfoFrame 
  243.          Caption         =   "PSInfo"
  244.          Height          =   5052
  245.          Left            =   120
  246.          TabIndex        =   21
  247.          Top             =   360
  248.          Width           =   8292
  249.          Begin VB.Frame Frame2 
  250.             Caption         =   "Length of Data"
  251.             Height          =   612
  252.             Left            =   120
  253.             TabIndex        =   30
  254.             Top             =   240
  255.             Width           =   1812
  256.             Begin VB.Label LengthLabel 
  257.                Alignment       =   2  'Center
  258.                Height          =   252
  259.                Left            =   120
  260.                TabIndex        =   31
  261.                Top             =   240
  262.                Width           =   1572
  263.             End
  264.          End
  265.          Begin VB.Frame Frame5 
  266.             Caption         =   "Number of Rows"
  267.             Height          =   612
  268.             Left            =   2040
  269.             TabIndex        =   28
  270.             Top             =   240
  271.             Width           =   1812
  272.             Begin VB.Label RowsLabel 
  273.                Alignment       =   2  'Center
  274.                Height          =   252
  275.                Left            =   120
  276.                TabIndex        =   29
  277.                Top             =   240
  278.                Width           =   1572
  279.             End
  280.          End
  281.          Begin VB.Frame Frame6 
  282.             Caption         =   "Number of Columns"
  283.             Height          =   612
  284.             Left            =   3960
  285.             TabIndex        =   26
  286.             Top             =   240
  287.             Width           =   1812
  288.             Begin VB.Label ColumnsLabel 
  289.                Alignment       =   2  'Center
  290.                Height          =   252
  291.                Left            =   120
  292.                TabIndex        =   27
  293.                Top             =   240
  294.                Width           =   1572
  295.             End
  296.          End
  297.          Begin VB.Frame PSDataFrame 
  298.             Caption         =   "PS Data"
  299.             Height          =   3972
  300.             Left            =   120
  301.             TabIndex        =   24
  302.             Top             =   960
  303.             Width           =   8052
  304.             Begin VB.TextBox PSDataText 
  305.                BackColor       =   &H00C0FFFF&
  306.                BeginProperty Font 
  307.                   name            =   "IBM3270"
  308.                   charset         =   0
  309.                   weight          =   400
  310.                   size            =   10.8
  311.                   underline       =   0   'False
  312.                   italic          =   0   'False
  313.                   strikethrough   =   0   'False
  314.                EndProperty
  315.                Height          =   3612
  316.                Left            =   120
  317.                Locked          =   -1  'True
  318.                MultiLine       =   -1  'True
  319.                ScrollBars      =   3  'Both
  320.                TabIndex        =   25
  321.                Top             =   240
  322.                Width           =   7812
  323.             End
  324.          End
  325.          Begin VB.Frame Frame9 
  326.             Caption         =   "Number of Fields"
  327.             Height          =   612
  328.             Left            =   5880
  329.             TabIndex        =   22
  330.             Top             =   240
  331.             Width           =   1812
  332.             Begin VB.Label NumberLabel 
  333.                Alignment       =   2  'Center
  334.                Height          =   252
  335.                Left            =   120
  336.                TabIndex        =   23
  337.                Top             =   240
  338.                Width           =   1572
  339.             End
  340.          End
  341.       End
  342.       Begin VB.Frame Frame1 
  343.          Caption         =   "Input Parameters"
  344.          Height          =   4092
  345.          Left            =   -73920
  346.          TabIndex        =   6
  347.          Top             =   840
  348.          Width           =   6372
  349.          Begin VB.Frame Frame4 
  350.             Caption         =   "Topic"
  351.             Height          =   612
  352.             Left            =   240
  353.             TabIndex        =   18
  354.             Top             =   2520
  355.             Width           =   2412
  356.             Begin VB.Label TopicLabel 
  357.                Alignment       =   2  'Center
  358.                Caption         =   "SessionA"
  359.                Height          =   252
  360.                Left            =   120
  361.                TabIndex        =   19
  362.                Top             =   240
  363.                Width           =   2172
  364.             End
  365.          End
  366.          Begin VB.ComboBox SessionIdList 
  367.             BackColor       =   &H00FFFFC0&
  368.             ForeColor       =   &H00000000&
  369.             Height          =   288
  370.             ItemData        =   "FSTPSAD.frx":0004
  371.             Left            =   1320
  372.             List            =   "FSTPSAD.frx":0056
  373.             Sorted          =   -1  'True
  374.             Style           =   2  'Dropdown List
  375.             TabIndex        =   17
  376.             Top             =   480
  377.             Width           =   492
  378.          End
  379.          Begin VB.Frame PSCondFrame 
  380.             Caption         =   "Conditions"
  381.             Enabled         =   0   'False
  382.             ForeColor       =   &H80000008&
  383.             Height          =   2052
  384.             Left            =   3720
  385.             TabIndex        =   11
  386.             Top             =   1800
  387.             Width           =   2412
  388.             Begin VB.CheckBox PSCondCaseSenCheck 
  389.                Caption         =   "Case &Sensitive"
  390.                Enabled         =   0   'False
  391.                ForeColor       =   &H80000008&
  392.                Height          =   252
  393.                Left            =   240
  394.                TabIndex        =   15
  395.                Top             =   1680
  396.                Width           =   1572
  397.             End
  398.             Begin VB.TextBox PSCondPosText 
  399.                BackColor       =   &H00FFFFC0&
  400.                Enabled         =   0   'False
  401.                ForeColor       =   &H00000000&
  402.                Height          =   288
  403.                Left            =   1200
  404.                TabIndex        =   14
  405.                Text            =   "0000"
  406.                Top             =   360
  407.                Width           =   468
  408.             End
  409.             Begin VB.Frame Frame7 
  410.                Caption         =   "Target String"
  411.                Height          =   852
  412.                Left            =   120
  413.                TabIndex        =   12
  414.                Top             =   720
  415.                Width           =   2172
  416.                Begin VB.TextBox PSCondStrText 
  417.                   BackColor       =   &H00FFFFC0&
  418.                   Enabled         =   0   'False
  419.                   ForeColor       =   &H00000000&
  420.                   Height          =   492
  421.                   Left            =   120
  422.                   MultiLine       =   -1  'True
  423.                   ScrollBars      =   1  'Horizontal
  424.                   TabIndex        =   13
  425.                   Top             =   240
  426.                   Width           =   1932
  427.                End
  428.             End
  429.             Begin VB.Label PSCondPosLabel 
  430.                Caption         =   "PS &Position"
  431.                Enabled         =   0   'False
  432.                ForeColor       =   &H80000008&
  433.                Height          =   252
  434.                Left            =   120
  435.                TabIndex        =   16
  436.                Top             =   360
  437.                Width           =   1068
  438.             End
  439.          End
  440.          Begin VB.CheckBox PSCondCheck 
  441.             Caption         =   "Set PS &Condition"
  442.             ForeColor       =   &H80000008&
  443.             Height          =   252
  444.             Left            =   3720
  445.             TabIndex        =   10
  446.             Top             =   1440
  447.             Width           =   1836
  448.          End
  449.          Begin VB.Frame UserDefFrame 
  450.             Caption         =   "User &Defined String"
  451.             Enabled         =   0   'False
  452.             ForeColor       =   &H80000008&
  453.             Height          =   612
  454.             Left            =   240
  455.             TabIndex        =   8
  456.             Top             =   1800
  457.             Width           =   2412
  458.             Begin VB.TextBox UserDefStrText 
  459.                BackColor       =   &H00FFFFC0&
  460.                Enabled         =   0   'False
  461.                ForeColor       =   &H00000000&
  462.                Height          =   288
  463.                Left            =   120
  464.                TabIndex        =   9
  465.                Text            =   "example"
  466.                Top             =   240
  467.                Width           =   2172
  468.             End
  469.          End
  470.          Begin VB.CheckBox TopicCheck 
  471.             Caption         =   "&Use Session Topic Name "
  472.             ForeColor       =   &H80000008&
  473.             Height          =   252
  474.             Left            =   240
  475.             TabIndex        =   7
  476.             Top             =   1440
  477.             Value           =   1  'Checked
  478.             Width           =   2508
  479.          End
  480.          Begin VB.Label Label1 
  481.             Caption         =   "Session &Id"
  482.             Height          =   252
  483.             Left            =   240
  484.             TabIndex        =   20
  485.             Top             =   480
  486.             Width           =   1092
  487.          End
  488.       End
  489.    End
  490.    Begin VB.Label ResultMessageLabel 
  491.       Alignment       =   2  'Center
  492.       Caption         =   "DDE Conversation Started"
  493.       ForeColor       =   &H00FF0000&
  494.       Height          =   252
  495.       Left            =   120
  496.       TabIndex        =   2
  497.       Top             =   5760
  498.       Visible         =   0   'False
  499.       Width           =   8532
  500.    End
  501. End
  502. Attribute VB_Name = "FormStartPSAdvise"
  503. Attribute VB_Creatable = False
  504. Attribute VB_Exposed = False
  505.  ' Should dynamically base these off of the number of fields.
  506.  Dim FieldStarts(0 To 1000) As String
  507.  Dim FieldLengths(0 To 1000) As String
  508.  Dim FieldAttributes(0 To 1000) As String
  509.  
  510. Private Sub ChangePSCondGroup(Status As Integer)
  511.  
  512.    PSCondFrame.Enabled = Status
  513.    TargetStringFrame.Enabled = Status
  514.    PSCondStrText.Enabled = Status
  515.    PSCondPosLabel.Enabled = Status
  516.    PSCondPosText.Enabled = Status
  517.    PSCondCaseSenCheck.Enabled = Status
  518.  
  519. End Sub
  520.  
  521. Private Sub GetAdvisePSInfo()
  522.   Dim BeginPosition As Integer
  523.   Dim EndPosition As Integer
  524.   
  525.   BeginPosition = 1
  526.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  527.   LengthLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  528.   
  529.   BeginPosition = EndPosition + 1
  530.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  531.   RowsLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  532.   
  533.   BeginPosition = EndPosition + 1
  534.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  535.   ColumnsLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  536.   
  537.   BeginPosition = EndPosition + 1
  538.   PSDataText.Text = Mid(PartialPSDataText.Text, BeginPosition, CInt(LengthLabel.Caption))
  539.   
  540.   BeginPosition = BeginPosition + CInt(LengthLabel.Caption) + 1 + 2 * (CInt(RowsLabel.Caption) - 1)
  541.                         ' +1 for Tab Character and + 1 for each newline character between each row
  542.   EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  543.   NumberLabel.Caption = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  544.   
  545.   FieldCombo.Clear
  546.   FieldRangeLabel.Caption = ""
  547.   TypeOfDataLabel.Caption = ""
  548.   IntensityLabel.Caption = ""
  549.   PenDectionLabel.Caption = ""
  550.   IsModifiedLabel.Caption = ""
  551.   
  552.   If CInt(NumberLabel.Caption) <> 0 Then
  553.   For Counter = 1 To CInt(NumberLabel.Caption)
  554.     ' Field Start
  555.     BeginPosition = EndPosition + 1
  556.     BeginFieldPosition = BeginPosition
  557.     EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  558.     FieldStarts(Counter) = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  559.     
  560.     ' Field Length
  561.     BeginPosition = EndPosition + 1
  562.     EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  563.     FieldLengths(Counter) = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  564.     
  565.     ' Field Attribute
  566.     BeginPosition = EndPosition + 1
  567.     EndPosition = InStr(BeginPosition, PartialPSDataText.Text, Chr$(9))
  568. ' A temporary fix.
  569. If EndPosition = 0 Then
  570.   MsgBox "EndPostion is 0"
  571. Else
  572.     FieldAttributes(Counter) = Mid(PartialPSDataText.Text, BeginPosition, EndPosition - BeginPosition)
  573.     FieldCombo.AddItem Counter
  574. End If
  575.   
  576.   Next Counter
  577.   End If
  578. End Sub
  579.  
  580. Private Sub BeginLabel_Click()
  581.  
  582. End Sub
  583.  
  584. Private Sub ExitCommand_Click()
  585.    Unload FormStartPSAdvise
  586. End Sub
  587.  
  588. Private Function GetPSItemName() As String
  589.    Dim FuncStatus As Integer
  590.    FuncStatus = ST_OK
  591.  
  592.    ReturnString$ = "PS"
  593.    If PSCondCheck.Value = CHECKED Then
  594.       PSPos$ = RTrim$(LTrim$(PSCondPosText.Text))
  595.       If Len(PSPos$) > 0 Then
  596.          TempStr$ = RTrim$(LTrim$(PSCondStrText.Text))
  597.          If Len(TempStr$) > 0 Then
  598.             If Left$(TempStr$, 1) = """" Then
  599.                TargetStr$ = TempStr$
  600.                TargetStrLen$ = LTrim$(Str$(Len(TargetStr$)))
  601.             Else
  602.                TargetStr$ = """" + TempStr$ + """"
  603.                TargetStrLen$ = LTrim$(Str$(Len(TargetStr$) - 2))
  604.             End If
  605.             If PSCondCaseSenCheck.Value = CHECKED Then
  606.                CaseSen$ = "1"
  607.             Else
  608.                CaseSen$ = "0"
  609.             End If
  610.             ReturnString$ = ReturnString$ + "(" + PSPos$ + "," + TargetStrLen$ + "," + CaseSen$ + "," + TargetStr$ + ")"
  611.          Else
  612.             FuncStatus = ST_ERROR
  613.          End If
  614.       Else
  615.          FuncStatus = ST_ERROR
  616.       End If
  617.    End If
  618.    If FuncStatus = ST_OK Then
  619.       GetPSItemName = ReturnString$
  620.    Else
  621.       MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  622.    End If
  623.  
  624. End Function
  625.  
  626. Private Function GetTopicName() As String
  627.  
  628.    If Len(SessionIdList.Text) > 0 Then
  629.       If TopicCheck.Value = CHECKED Then
  630.          ReturnString$ = "Session" + SessionIdList.Text
  631.       Else
  632.          ReturnString$ = "Sess" + SessionIdList.Text + "_" + UserDefStrText.Text
  633.       End If
  634.       GetTopicName = ReturnString$
  635.    Else
  636.       MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  637.    End If
  638. End Function
  639.  
  640.  
  641. Private Sub FieldCombo_Click()
  642.  Dim FieldAttribute As Byte
  643.  Dim StartOfField As Integer
  644.  Dim length As Integer
  645.  Dim EndOfField As Integer
  646.  
  647.  StartOfField = FieldStarts(FieldCombo.Text)
  648.  length = FieldLengths(FieldCombo.Text)
  649.  EndOfField = StartOfField + length - 1
  650.  FieldAttribute = Asc(FieldAttributes(FieldCombo.Text))
  651.   
  652.  FieldRangeLabel.Caption = StartOfField & "-" & EndOfField
  653.   
  654.   If FieldAttribute And &H10& Then
  655.    TypeOfDataLabel.Caption = "Numeric"
  656.  Else
  657.    TypeOfDataLabel.Caption = "AlphaNumeric"
  658.  End If
  659.  
  660.  If FieldAttribute And &H20& Then
  661.    IsProtectedLabel.Caption = "Yes"
  662.  Else
  663.    IsProtectedLabel.Caption = "No"
  664.  End If
  665.  
  666.  If ((FieldAttribute And &HC&) = &H0&) Then
  667.    IntensityLabel.Caption = "Normal"
  668.    PenDectionLabel.Caption = "No"
  669.  ElseIf ((FieldAttribute And &HC&) = &H4&) Then
  670.    IntensityLabel.Caption = "Normal"
  671.    PenDectionLabel.Caption = "Yes"
  672.  ElseIf ((FieldAttribute And &HC&) = &H8&) Then
  673.    IntensityLabel.Caption = "High"
  674.    PenDectionLabel.Caption = "Yes"
  675.  Else
  676.    IntensityLabel.Caption = "Non-Display"
  677.    PenDectionLabel.Caption = "No"
  678.  End If
  679.  
  680.  If FieldAttribute And &H1& Then
  681.    IsModifiedLabel.Caption = "Yes"
  682.  Else
  683.    IsModifiedLabel.Caption = "No"
  684.  End If
  685.  
  686. End Sub
  687.  
  688.  
  689. Private Sub Form_Load()
  690.   SessionIdList.ListIndex = 0
  691.   AdjustForNT351 FormStartPSAdvise
  692. End Sub
  693.  
  694. Private Sub PartialPSDataText_Change()
  695.   If StartCommand.Enabled = False Then
  696.       PSDataLen& = Val(Left$(PartialPSDataText.Text, 4)) + 15
  697.       LogData$(LogEnd) = Time$ + ":PS was updated :" + Chr$(13) + Chr$(10)
  698.       UpdateLogPointer
  699.       UpdateLog
  700.  
  701.       GetAdvisePSInfo
  702.       If CInt(NumberLabel.Caption) <> 0 Then
  703.         FieldCombo.ListIndex = 0
  704.       End If
  705.       SSTab1.Tab = 1
  706.   End If
  707. End Sub
  708.  
  709. Private Sub PSCondCheck_Click()
  710.  
  711.   If PSCondCheck.Value = CHECKED Then
  712.      ChangePSCondGroup (True)
  713.   Else
  714.      ChangePSCondGroup (False)
  715.   End If
  716.  
  717. End Sub
  718.  
  719. Private Sub PSDataText_Change()
  720. '   If StartCommand.Enabled = False Then
  721. '      PSDataLen& = Val(Left$(PSDataText.Text, 4)) + 15
  722. '      LogData$(LogEnd) = Time$ + ":PS was updated :" + Chr$(13) + Chr$(10)
  723. '      UpdateLogPointer
  724. '      UpdateLog
  725. '   End If
  726. End Sub
  727.  
  728. Private Sub StartCommand_Click()
  729. On Error GoTo ErrHandler
  730.    FunctionComp = True
  731.    
  732.    OldMousePointer = MousePointer
  733.    MousePointer = 11 ' Hour Glass Mouse Pointer
  734.    
  735.    DisplayType$ = GetDisplayType$(SessionIdList.Text)
  736.    
  737.    If DisplayType$ = "NONE" Then
  738.       MousePointer = OldMousePointer
  739.       MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
  740.       Exit Sub
  741.    End If
  742.    
  743.    Topic$ = GetTopicName()
  744.    If Len(Topic$) <= 0 Then
  745.      MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  746.      MousePointer = OldMousePointer
  747.      Exit Sub
  748.    End If
  749.    
  750.    Item$ = GetPSItemName()
  751.    If Len(Item$) <= 0 Then
  752.      MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  753.      MousePointer = OldMousePointer
  754.      Exit Sub
  755.    End If
  756.       
  757.          rc = DoEvents()        'If you use VisualBasic V2.0, call
  758.                                 'DoEvents function each time before
  759.                                 'starting DDE conversation.
  760.          PartialPSDataText.LinkTimeout = -1
  761.          PartialPSDataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
  762.          PartialPSDataText.LinkItem = Item$
  763.          PartialPSDataText.LinkMode = HOT
  764.       
  765.        MousePointer = OldMousePointer
  766.          If FunctionComp = True Then
  767.             ResultMessageLabel.Visible = True
  768.             StartCommand.Enabled = False
  769.             StopCommand.Enabled = True
  770.             ExitCommand.Enabled = False
  771.             EndStatus$ = MSG_OK
  772.          Else
  773.             ResultMessageLabel.Visible = False
  774.             MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  775.             EndStatus$ = MSG_NG
  776.          End If
  777.          TempLogData$ = Time$ + ":Start Session Advise (PS) : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  778.          TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  779.          TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  780.          TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10)
  781.          LogData$(LogEnd) = TempLogData$
  782.          UpdateLogPointer
  783.          UpdateLog
  784.    Exit Sub
  785.  
  786. ErrHandler:
  787.    FunctionComp = False
  788.    Resume Next
  789. End Sub
  790.  
  791. Private Sub StopCommand_Click()
  792. On Error GoTo StopErrHandler
  793.    FunctionComp = True
  794.    
  795.    PartialPSDataText.LinkTimeout = -1
  796.    PartialPSDataText.LinkMode = NONE
  797.    If FunctionComp = True Then
  798.       ResultMessageLabel.Visible = False
  799.       EndStatus$ = MSG_OK
  800.       StopCommand.Enabled = False
  801.       StartCommand.Enabled = True
  802.       ExitCommand.Enabled = True
  803.    Else
  804.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  805.       EndStatus$ = MSG_NG
  806.    End If
  807.    LogData$(LogEnd) = Time$ + ":Stop Session Advise (PS) : " + EndStatus$ + Chr$(13) + Chr$(10)
  808.    UpdateLogPointer
  809.    UpdateLog
  810.    Exit Sub
  811.  
  812. StopErrHandler:
  813.    FunctionEnd = False
  814.    Resume Next
  815. End Sub
  816.  
  817. Private Sub TopicCheck_Click()
  818.   If TopicCheck.Value = CHECKED Then
  819.      UserDefFrame.Enabled = False
  820.      UserDefStrText.Enabled = False
  821.   Else
  822.      UserDefFrame.Enabled = True
  823.      UserDefStrText.Enabled = True
  824.   End If
  825.   
  826.   TopicLabel.Caption = GetTopicName()
  827. End Sub
  828.  
  829. Private Sub UpdateLog()
  830.     temp$ = " "
  831.     If LogTop > LogEnd Then
  832.        For i% = LogTop To MAXLOGNUM
  833.           temp$ = temp$ + LogData$(i%)
  834.        Next
  835.        For i% = 0 To LogEnd
  836.           temp$ = temp$ + LogData$(i%)
  837.        Next
  838.     ElseIf LogTop < LogEnd Then
  839.        For i% = LogTop To LogEnd
  840.           temp$ = temp$ + LogData(i%)
  841.        Next
  842.     Else
  843.        temp$ = LogData(i%)
  844.     End If
  845.     MainForm.FunctionLog.Text = temp$
  846.     Loged = False
  847. End Sub
  848.  
  849. Private Sub UpdateLogPointer()
  850.     LogEnd = LogEnd + 1
  851.     If LogEnd = MAXLOGNUM + 1 Then
  852.        LogEnd = 0
  853.     End If
  854.  
  855.     If LogTop = LogEnd Then
  856.        LogTop = LogTop + 1
  857.        If LogTop = MAXLOGNUM + 1 Then
  858.           LogTop = 0
  859.        End If
  860.     End If
  861. End Sub
  862.  
  863. Private Sub UserDefStrText_Change()
  864.   TopicLabel.Caption = GetTopicName()
  865. End Sub
  866.  
  867.  
  868.