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

  1. VERSION 4.00
  2. Begin VB.Form FormGetOIA 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Get Operator Indicator Area"
  5.    ClientHeight    =   4560
  6.    ClientLeft      =   1836
  7.    ClientTop       =   2736
  8.    ClientWidth     =   8856
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   7.8
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   4884
  20.    Left            =   1788
  21.    LinkMode        =   1  'Source
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   4560
  26.    ScaleWidth      =   8856
  27.    ShowInTaskbar   =   0   'False
  28.    Top             =   2460
  29.    Width           =   8952
  30.    Begin VB.Frame Frame2 
  31.       Caption         =   "Input Inhibited"
  32.       Height          =   612
  33.       Left            =   240
  34.       TabIndex        =   8
  35.       Top             =   1800
  36.       Width           =   2892
  37.       Begin VB.Label InputInhibitLabel 
  38.          Height          =   252
  39.          Left            =   96
  40.          TabIndex        =   9
  41.          Top             =   240
  42.          Width           =   2700
  43.       End
  44.    End
  45.    Begin VB.Frame Frame1 
  46.       Caption         =   "Online and Owership"
  47.       Height          =   612
  48.       Left            =   240
  49.       TabIndex        =   6
  50.       Top             =   1080
  51.       Width           =   2892
  52.       Begin VB.Label OnlineLabel 
  53.          Height          =   252
  54.          Left            =   96
  55.          TabIndex        =   7
  56.          Top             =   240
  57.          Width           =   2556
  58.       End
  59.    End
  60.    Begin VB.ComboBox SessionIdList 
  61.       BackColor       =   &H00FFFFC0&
  62.       ForeColor       =   &H00000000&
  63.       Height          =   288
  64.       ItemData        =   "FGETOIA.frx":0000
  65.       Left            =   1320
  66.       List            =   "FGETOIA.frx":0052
  67.       Sorted          =   -1  'True
  68.       Style           =   2  'Dropdown List
  69.       TabIndex        =   2
  70.       Top             =   360
  71.       Width           =   492
  72.    End
  73.    Begin VB.CommandButton ExitDlg 
  74.       Cancel          =   -1  'True
  75.       Caption         =   "E&xit"
  76.       Height          =   372
  77.       Left            =   5400
  78.       TabIndex        =   4
  79.       Top             =   4080
  80.       Width           =   852
  81.    End
  82.    Begin VB.CommandButton Execute 
  83.       Caption         =   "&Execute"
  84.       Default         =   -1  'True
  85.       Height          =   372
  86.       Left            =   2640
  87.       TabIndex        =   3
  88.       Top             =   4080
  89.       Width           =   876
  90.    End
  91.    Begin VB.Frame MWFrame 
  92.       Caption         =   "MW"
  93.       Height          =   612
  94.       Left            =   6000
  95.       TabIndex        =   25
  96.       Top             =   1800
  97.       Width           =   2604
  98.       Begin VB.Label MWLabel 
  99.          Height          =   252
  100.          Left            =   96
  101.          TabIndex        =   26
  102.          Top             =   240
  103.          Width           =   2412
  104.       End
  105.    End
  106.    Begin VB.Frame Frame8 
  107.       Caption         =   "Insert mode"
  108.       Height          =   612
  109.       Left            =   6000
  110.       TabIndex        =   21
  111.       Top             =   2520
  112.       Width           =   2652
  113.       Begin VB.Label InsertLabel 
  114.          Height          =   252
  115.          Left            =   96
  116.          TabIndex        =   22
  117.          Top             =   240
  118.          Width           =   1836
  119.       End
  120.    End
  121.    Begin VB.Frame Frame9 
  122.       Caption         =   "Printer State"
  123.       Height          =   612
  124.       Left            =   3240
  125.       TabIndex        =   23
  126.       Top             =   1800
  127.       Width           =   2604
  128.       Begin VB.Label PrinterLabel 
  129.          Height          =   252
  130.          Left            =   96
  131.          TabIndex        =   24
  132.          Top             =   240
  133.          Width           =   2220
  134.       End
  135.    End
  136.    Begin VB.Frame Frame3 
  137.       Caption         =   "Communication error"
  138.       Height          =   612
  139.       Left            =   240
  140.       TabIndex        =   10
  141.       Top             =   2520
  142.       Width           =   2892
  143.       Begin VB.Label CommErrLabel 
  144.          Height          =   252
  145.          Left            =   120
  146.          TabIndex        =   11
  147.          Top             =   240
  148.          Width           =   2676
  149.       End
  150.    End
  151.    Begin VB.Frame Frame7 
  152.       Caption         =   "Color"
  153.       Height          =   612
  154.       Left            =   6000
  155.       TabIndex        =   19
  156.       Top             =   1080
  157.       Width           =   2604
  158.       Begin VB.Label ColorLabel 
  159.          Height          =   252
  160.          Left            =   96
  161.          TabIndex        =   20
  162.          Top             =   240
  163.          Width           =   1836
  164.       End
  165.    End
  166.    Begin VB.Frame Frame5 
  167.       Caption         =   "Shift State"
  168.       Height          =   612
  169.       Left            =   3240
  170.       TabIndex        =   14
  171.       Top             =   3240
  172.       Width           =   2652
  173.       Begin VB.Label CAPSLabel 
  174.          Height          =   252
  175.          Left            =   1320
  176.          TabIndex        =   16
  177.          Top             =   240
  178.          Width           =   1236
  179.       End
  180.       Begin VB.Label ShiftLabel 
  181.          Height          =   252
  182.          Left            =   96
  183.          TabIndex        =   15
  184.          Top             =   240
  185.          Width           =   1236
  186.       End
  187.    End
  188.    Begin VB.Frame Frame6 
  189.       Caption         =   "Highlight"
  190.       Height          =   612
  191.       Left            =   3240
  192.       TabIndex        =   17
  193.       Top             =   1080
  194.       Width           =   2604
  195.       Begin VB.Label HightlightLabel 
  196.          Height          =   252
  197.          Left            =   96
  198.          TabIndex        =   18
  199.          Top             =   240
  200.          Width           =   2124
  201.       End
  202.    End
  203.    Begin VB.Frame Frame4 
  204.       Caption         =   "Character Selection"
  205.       Height          =   612
  206.       Left            =   3240
  207.       TabIndex        =   12
  208.       Top             =   2520
  209.       Width           =   2652
  210.       Begin VB.Label APLLabel 
  211.          Height          =   252
  212.          Left            =   96
  213.          TabIndex        =   13
  214.          Top             =   240
  215.          Width           =   1596
  216.       End
  217.    End
  218.    Begin VB.TextBox GetOIADataText 
  219.       BackColor       =   &H00C0FFFF&
  220.       BeginProperty Font 
  221.          name            =   "System"
  222.          charset         =   0
  223.          weight          =   700
  224.          size            =   9.6
  225.          underline       =   0   'False
  226.          italic          =   0   'False
  227.          strikethrough   =   0   'False
  228.       EndProperty
  229.       ForeColor       =   &H00FF0000&
  230.       Height          =   360
  231.       Left            =   2160
  232.       Locked          =   -1  'True
  233.       MaxLength       =   80
  234.       MultiLine       =   -1  'True
  235.       TabIndex        =   5
  236.       TabStop         =   0   'False
  237.       Top             =   360
  238.       Width           =   6372
  239.    End
  240.    Begin VB.Frame Frame10 
  241.       Caption         =   "Input Parameters"
  242.       Height          =   612
  243.       Left            =   120
  244.       TabIndex        =   0
  245.       Top             =   120
  246.       Width           =   1812
  247.       Begin VB.Label Label1 
  248.          Caption         =   "Session &Id"
  249.          Height          =   252
  250.          Left            =   120
  251.          TabIndex        =   1
  252.          Top             =   240
  253.          Width           =   1092
  254.       End
  255.    End
  256.    Begin VB.Frame Frame11 
  257.       Caption         =   "OIA Information"
  258.       Height          =   3132
  259.       Left            =   120
  260.       TabIndex        =   27
  261.       Top             =   840
  262.       Width           =   8652
  263.    End
  264.    Begin VB.Frame Frame12 
  265.       Caption         =   "OIA Data"
  266.       Height          =   732
  267.       Left            =   2040
  268.       TabIndex        =   28
  269.       Top             =   120
  270.       Width           =   6612
  271.    End
  272. End
  273. Attribute VB_Name = "FormGetOIA"
  274. Attribute VB_Creatable = False
  275. Attribute VB_Exposed = False
  276.  
  277. Private Sub DisplayOIAState()
  278.  
  279.    TempOIAData$ = RTrim$(Mid$(GetOIADataText.Text, 1, 7))
  280.    If TempOIAData$ = "ONLINE" Then
  281.       OnlineLabel.Caption = "Online and Not Owned"
  282.    ElseIf TempOIAData$ = "LU-LU" Then
  283.       OnlineLabel.Caption = "LU-LU Session"
  284.    ElseIf TempOIAData$ = "SSCP-LU" Then
  285.       OnlineLabel.Caption = "SSCP-LU Session"
  286.    End If
  287.    
  288.    TempOIAData$ = RTrim$(Mid$(GetOIADataText.Text, 10, 8))
  289.    If TempOIAData$ = "X MCHK" Then
  290.       InputInhibitLabel.Caption = "Machine check"
  291.    ElseIf TempOIAData$ = "X CCHK" Then
  292.       InputInhibitLabel.Caption = "Communication check"
  293.    ElseIf TempOIAData$ = "X PCHK" Then
  294.       InputInhibitLabel.Caption = "Program check"
  295.    ElseIf TempOIAData$ = "X DNW" Then
  296.       InputInhibitLabel.Caption = "Device not working"
  297.    ElseIf TempOIAData$ = "X BUSY" Then
  298.       InputInhibitLabel.Caption = "Printing"
  299.    ElseIf TempOIAData$ = "X TWAIT" Then
  300.       InputInhibitLabel.Caption = "Terminal wait"
  301.    ElseIf TempOIAData$ = "X -S" Then
  302.       InputInhibitLabel.Caption = "Minus symbol"
  303.    ElseIf TempOIAData$ = "X -f" Then
  304.       InputInhibitLabel.Caption = "Minus funciton"
  305.    ElseIf TempOIAData$ = "X MUCH" Then
  306.       InputInhibitLabel.Caption = "Too much entered"
  307.    ElseIf TempOIAData$ = "X UA" Then
  308.       InputInhibitLabel.Caption = "Operator unauthorized"
  309.    ElseIf TempOIAData$ = "X -fUA" Then
  310.       InputInhibitLabel.Caption = "Operator unauthorized minus funciton"
  311.    ElseIf TempOIAData$ = "X DEAD" Then
  312.       InputInhibitLabel.Caption = "Invalid dead key combination"
  313.    ElseIf TempOIAData$ = "X WRONG" Then
  314.       InputInhibitLabel.Caption = "Wrong place"
  315.    ElseIf TempOIAData$ = "X SYSTEM" Then
  316.       InputInhibitLabel.Caption = "System wait"
  317.    ElseIf TempOIAData$ = "X II" Then
  318.       InputInhibitLabel.Caption = "Operator input error"
  319.    ElseIf TempOIAData$ = "X" Then
  320.       InputInhibitLabel.Caption = "Input inhibited"
  321.    End If
  322.  
  323.    TempOIAData$ = Mid$(GetOIADataText.Text, 20, 4)
  324.    If TempOIAData$ = "COMM" Then
  325.       CommErrLabel.Caption = "Communication error"
  326.    End If
  327.  
  328.    TempOIAData$ = Mid$(GetOIADataText.Text, 26, 2)
  329.    If TempOIAData$ = "MW" Then
  330.       MWLabel.Caption = "Message waiting"
  331.    End If
  332.  
  333.    TempOIAData$ = Mid$(GetOIADataText.Text, 37, 3)
  334.    If TempOIAData$ = "APL" Then
  335.       APLLabel.Caption = "APL"
  336.    End If
  337.  
  338.    TempOIAData$ = Mid$(GetOIADataText.Text, 43, 1)
  339.    If TempOIAData$ = "U" Then
  340.       ShiftLabel.Caption = "Upper shift"
  341.    ElseIf TempOIAData$ = "N" Then
  342.       ShiftLabel.Caption = "Numeric"
  343.    End If
  344.  
  345.    TempOIAData$ = Mid$(GetOIADataText.Text, 44, 1)
  346.    If TempOIAData$ = "A" Then
  347.       CAPSLabel.Caption = "CAPS"
  348.    End If
  349.  
  350.    TempOIAData$ = Mid$(GetOIADataText.Text, 48, 1)
  351.    If TempOIAData$ = "S" Then
  352.       HightlightLabel.Caption = "Operator selectable"
  353.    ElseIf TempOIAData$ = "I" Then
  354.       HightlightLabel.Caption = "Field inherit"
  355.    End If
  356.  
  357.    TempOIAData$ = Mid$(GetOIADataText.Text, 50, 2)
  358.    If TempOIAData$ = "CS" Then
  359.       ColorLabel.Caption = "Operator selectable"
  360.    ElseIf TempOIAData$ = "CI" Then
  361.       ColorLabel.Caption = "Field inherit"
  362.    End If
  363.  
  364.    TempOIAData$ = Mid$(GetOIADataText.Text, 53, 1)
  365.    If TempOIAData$ = "^" Then
  366.       InsertLabel.Caption = "Insert mode"
  367.    End If
  368.  
  369.    TempOIAData$ = Mid$(GetOIADataText.Text, 62, 5)
  370.    If TempOIAData$ = "P-MAL" Then
  371.       PrinterLabel.Caption = "Printer makfunction"
  372.    ElseIf TempOIAData$ = "P-PRN" Then
  373.       PrinterLabel.Caption = "Printer printing"
  374.    ElseIf TempOIAData$ = "P-ASS" Then
  375.       PrinterLabel.Caption = "Printer assignment"
  376.    End If
  377.  
  378. End Sub
  379.  
  380. Private Sub Execute_Click()
  381. On Error GoTo ErrHandler
  382.    FunctionComp = True
  383.  
  384.    OldMousePointer = MousePointer
  385.    MousePointer = 11 ' Hour Glass Mouse Pointer
  386.    ClearOutput
  387.       
  388.    If GetDisplayType$(SessionIdList.Text) = "NONE" Then
  389.       MousePointer = OldMousePointer
  390.       MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
  391.       Exit Sub
  392.    End If
  393.  
  394.    
  395.    temp$ = LTrim$(RTrim$(SessionIdList.Text))
  396.    If Len(temp$) > 0 Then
  397.       Topic$ = "Session" + temp$
  398.    Else
  399.       MousePointer = OldMousePointer
  400.       MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
  401.       Exit Sub
  402.    End If
  403.    Item$ = "OIA"
  404.    
  405.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  406.                                 'DoEvents function each time before
  407.                                 'starting DDE conversation.
  408.    GetOIADataText.LinkTimeout = -1
  409.    GetOIADataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
  410.    GetOIADataText.LinkMode = COLD
  411.    GetOIADataText.LinkItem = Item$
  412.    GetOIADataText.LinkRequest
  413.    GetOIADataText.LinkMode = NONE
  414.  
  415.    MousePointer = OldMousePointer
  416.    If FunctionComp = True Then
  417.       DisplayOIAState
  418.       MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
  419.       EndStatus$ = MSG_OK
  420.    Else
  421.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  422.       EndStatus$ = MSG_NG
  423.    End If
  424.    TempLogData$ = Time$ + ":Get OIA : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  425.    TempLogData$ = TempLogData$ + MSG_APPLICATION + """" + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  426.    TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  427.    TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
  428.    TempLogData$ = TempLogData$ + "Data =" + """" + GetOIADataText.Text + """" + Chr$(13) + Chr$(10)
  429.    LogData$(LogEnd) = TempLogData$
  430.    UpdateLogPointer
  431.    Loged = True
  432.    Exit Sub
  433.  
  434. ErrHandler:
  435.    FunctionComp = False
  436. MsgBox Err.Number
  437.    Resume Next
  438. End Sub
  439.  
  440. Private Sub ExitDlg_Click()
  441.     Hide
  442. End Sub
  443.  
  444. Private Sub Form_Load()
  445.   SessionIdList.ListIndex = 0
  446.  
  447.    If APPLICATION_NAME = "IBM3270" Then
  448.       MWFrame.Enabled = False
  449.       MWLabel.Enabled = False
  450.    End If
  451. End Sub
  452.  
  453. Private Sub UpdateLogPointer()
  454.     LogEnd = LogEnd + 1
  455.     If LogEnd = MAXLOGNUM + 1 Then
  456.        LogEnd = 0
  457.     End If
  458.  
  459.     If LogTop = LogEnd Then
  460.        LogTop = LogTop + 1
  461.        If LogTop = MAXLOGNUM + 1 Then
  462.           LogTop = 0
  463.        End If
  464.     End If
  465. End Sub
  466.  
  467. Private Sub ClearOutput()
  468.  
  469.   GetOIADataText.Text = ""
  470.   OnlineLabel.Caption = ""
  471.   InputInhibitLabel.Caption = ""
  472.   CommErrLabel.Caption = ""
  473.   MWLabel.Caption = ""
  474.   APLLabel.Caption = ""
  475.   ShiftLabel.Caption = ""
  476.   CAPSLabel.Caption = ""
  477.   HightlightLabel.Caption = ""
  478.   ColorLabel.Caption = ""
  479.   InsertLabel.Caption = ""
  480.   PrinterLabel.Caption = ""
  481.  
  482. End Sub
  483.