home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fstoiaad.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
20KB
|
662 lines
VERSION 4.00
Begin VB.Form FormStartOIAAdvise
BorderStyle = 3 'Fixed Dialog
Caption = "Start Session Advise (OIA)"
ClientHeight = 6744
ClientLeft = 2004
ClientTop = 1704
ClientWidth = 8544
ControlBox = 0 'False
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 7.8
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 7068
Left = 1956
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6744
ScaleWidth = 8544
ShowInTaskbar = 0 'False
Top = 1428
Width = 8640
Begin VB.Frame Frame10
Caption = "OIA Data"
ForeColor = &H80000008&
Height = 972
Left = 120
TabIndex = 31
Top = 1800
Width = 8172
Begin VB.TextBox OIADataText
BackColor = &H00C0FFFF&
BeginProperty Font
name = "System"
charset = 0
weight = 700
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 612
Left = 120
Locked = -1 'True
MaxLength = 80
MultiLine = -1 'True
TabIndex = 32
TabStop = 0 'False
Top = 240
Width = 7932
End
End
Begin VB.Frame Frame9
Caption = "Printer State"
ForeColor = &H80000008&
Height = 615
Left = 3360
TabIndex = 24
Top = 3840
Width = 2415
Begin VB.Label PrinterLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 25
Top = 240
Width = 2220
End
End
Begin VB.Frame MWFrame
Caption = "MW"
ForeColor = &H80000008&
Height = 615
Left = 5880
TabIndex = 29
Top = 3840
Width = 2415
Begin VB.Label MWLabel
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 30
Top = 240
Width = 1836
End
End
Begin VB.CommandButton ExitCommand
Cancel = -1 'True
Caption = "E&xit"
Height = 375
Left = 5400
TabIndex = 8
Top = 6240
Width = 855
End
Begin VB.CommandButton StopCommand
Caption = "&End"
Enabled = 0 'False
Height = 375
Left = 3840
TabIndex = 7
Top = 6240
Width = 855
End
Begin VB.CommandButton StartCommand
Caption = "&Begin"
Default = -1 'True
Height = 375
Left = 2280
TabIndex = 6
Top = 6240
Width = 855
End
Begin VB.Frame Frame7
Caption = "Color"
ForeColor = &H80000008&
Height = 615
Left = 5880
TabIndex = 20
Top = 3120
Width = 2415
Begin VB.Label ColorLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 21
Top = 240
Width = 1836
End
End
Begin VB.Frame Frame8
Caption = "Insert mode"
ForeColor = &H80000008&
Height = 615
Left = 5880
TabIndex = 26
Top = 4560
Width = 2415
Begin VB.Label InsertLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 27
Top = 240
Width = 1836
End
End
Begin VB.Frame Frame2
Caption = "Input Inhibited"
ForeColor = &H80000008&
Height = 615
Left = 240
TabIndex = 15
Top = 3840
Width = 3015
Begin VB.Label InputInhibitLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 16
Top = 240
Width = 2700
End
End
Begin VB.Frame Frame6
Caption = "Highlight"
ForeColor = &H80000008&
Height = 615
Left = 3360
TabIndex = 13
Top = 3120
Width = 2415
Begin VB.Label HightlightLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 14
Top = 240
Width = 2124
End
End
Begin VB.Frame Frame4
Caption = "Character Selection"
ForeColor = &H80000008&
Height = 615
Left = 3360
TabIndex = 11
Top = 4560
Width = 2415
Begin VB.Label APLLabel
ForeColor = &H80000008&
Height = 252
Left = 192
TabIndex = 12
Top = 240
Width = 492
End
End
Begin VB.Frame Frame1
Caption = "Online and Owership"
ForeColor = &H80000008&
Height = 615
Left = 240
TabIndex = 9
Top = 3120
Width = 3015
Begin VB.Label OnlineLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 10
Top = 240
Width = 2124
End
End
Begin VB.Frame Frame5
Caption = "Shft State"
ForeColor = &H80000008&
Height = 615
Left = 3360
TabIndex = 17
Top = 5280
Width = 2415
Begin VB.Label CAPSLabel
ForeColor = &H80000008&
Height = 252
Left = 1152
TabIndex = 19
Top = 240
Width = 1068
End
Begin VB.Label ShiftLabel
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 18
Top = 240
Width = 1068
End
End
Begin VB.Frame Frame3
Caption = "Communication error"
ForeColor = &H80000008&
Height = 612
Left = 240
TabIndex = 22
Top = 4560
Width = 3012
Begin VB.Label CommErrLabel
ForeColor = &H80000008&
Height = 255
Left = 120
TabIndex = 23
Top = 240
Width = 1830
End
End
Begin VB.Frame UserDefFrame
Caption = "User Defined &String"
Enabled = 0 'False
ForeColor = &H80000008&
Height = 612
Left = 2040
TabIndex = 4
Top = 720
Width = 2772
Begin VB.TextBox UserDefStrText
BackColor = &H00FFFFC0&
Enabled = 0 'False
ForeColor = &H00000000&
Height = 288
Left = 120
TabIndex = 5
Text = "example"
Top = 240
Width = 2532
End
End
Begin VB.CheckBox TopicCheck
Caption = "&Use Session Topic Name "
ForeColor = &H80000008&
Height = 372
Left = 2040
TabIndex = 3
Top = 360
Value = 1 'Checked
Width = 2412
End
Begin VB.Frame Frame11
Caption = "Input Parameters"
Height = 1332
Left = 120
TabIndex = 0
Top = 120
Width = 8172
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FSTOIAAD.frx":0000
Left = 1080
List = "FSTOIAAD.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 360
Width = 492
End
Begin VB.Frame Frame13
Caption = "Topic"
Height = 612
Left = 4800
TabIndex = 34
Top = 600
Width = 3252
Begin VB.Label TopicLabel
Alignment = 2 'Center
Caption = "SessionA"
Height = 252
Left = 120
TabIndex = 35
Top = 240
Width = 3012
End
End
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 1
Top = 360
Width = 972
End
End
Begin VB.Frame Frame12
Caption = "OIA Information"
Height = 3252
Left = 120
TabIndex = 33
Top = 2880
Width = 8292
End
Begin VB.Label ResultMessageLabel
Alignment = 2 'Center
Caption = "DDE Conversation Started"
ForeColor = &H00FF0000&
Height = 252
Left = 120
TabIndex = 28
Top = 1560
Visible = 0 'False
Width = 8172
End
End
Attribute VB_Name = "FormStartOIAAdvise"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub ExitCommand_Click()
Unload FormStartOIAAdvise
End Sub
Private Sub Form_Load()
SessionIdList.ListIndex = 0
If APPLICATION_NAME = "IBM3270" Then
MWFrame.Enabled = False
MWLabel.Enabled = False
End If
End Sub
Private Function GetTopicName() As String
If Len(SessionIdList.Text) > 0 Then
If TopicCheck.Value = CHECKED Then
ReturnString$ = "Session" + SessionIdList.Text
Else
ReturnString$ = "Sess" + SessionIdList.Text + "_" + UserDefStrText.Text
End If
GetTopicName = ReturnString$
Else
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
End If
End Function
Private Sub OIADataText_Change()
If StartCommand.Enabled = False Then
ShowOIAGroup
LogData$(LogEnd) = Time$ + ":OIA was updated :" + Chr$(13) + Chr$(10) + Chr$(9) + "Data=" + OIADataText.Text + Chr$(13) + Chr$(10)
UpdateLogPointer
UpdateLog
End If
End Sub
Private Sub ShowOIAGroup()
temp$ = RTrim$(Mid$(OIADataText.Text, 1, 7))
If temp$ = "ONLINE" Then
OnlineLabel.Caption = "Online and Not Owned"
ElseIf temp$ = "LU-LU" Then
OnlineLabel.Caption = "LU-LU Session"
ElseIf temp$ = "SSCP-LU" Then
OnlineLabel.Caption = "SSCP-LU Session"
Else
OnlineLabel.Caption = " "
End If
temp$ = RTrim$(Mid$(OIADataText.Text, 10, 8))
If temp$ = "X MCHK" Then
InputInhibitLabel.Caption = "Machine check"
ElseIf temp$ = "X CCHK" Then
InputInhibitLabel.Caption = "Communication check"
ElseIf temp$ = "X PCHK" Then
InputInhibitLabel.Caption = "Program check"
ElseIf temp$ = "X DNW" Then
InputInhibitLabel.Caption = "Device not working"
ElseIf temp$ = "X BUSY" Then
InputInhibitLabel.Caption = "Printing"
ElseIf temp$ = "X TWAIT" Then
InputInhibitLabel.Caption = "Terminal wait"
ElseIf temp$ = "X -S" Then
InputInhibitLabel.Caption = "Minus symbol"
ElseIf temp$ = "X -f" Then
InputInhibitLabel.Caption = "Minus funciton"
ElseIf temp$ = "X MUCH" Then
InputInhibitLabel.Caption = "Too much entered"
ElseIf temp$ = "X UA" Then
InputInhibitLabel.Caption = "Operator unauthorized"
ElseIf temp$ = "X -fUA" Then
InputInhibitLabel.Caption = "Operator unauthorized minus funciton"
ElseIf temp$ = "X DEAD" Then
InputInhibitLabel.Caption = "Invalid dead key combination"
ElseIf temp$ = "X WRONG" Then
InputInhibitLabel.Caption = "Wrong place"
ElseIf temp$ = "X SYSTEM" Then
InputInhibitLabel.Caption = "System wait"
ElseIf temp$ = "X II" Then
InputInhibitLabel.Caption = "Operater input error"
ElseIf temp$ = "X" Then
InputInhibitLabel.Caption = "Input inhibited"
Else
InputInhibitLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 20, 4)
If temp$ = "COMM" Then
CommErrLabel.Caption = "Communication error"
Else
CommErrLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 26, 2)
If temp$ = "MW" Then
MWLabel.Caption = "Message waiting"
Else
MWLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 37, 3)
If temp$ = "APL" Then
APLLabel.Caption = "APL"
Else
APLLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 43, 1)
If temp$ = "U" Then
ShiftLabel.Caption = "Upper shift"
ElseIf temp$ = "N" Then
ShiftLabel.Caption = "Numeric"
Else
ShiftLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 44, 1)
If temp$ = "A" Then
CAPSLabel.Caption = "CAPS"
Else
CAPSLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 48, 1)
If temp$ = "S" Then
HightlightLabel.Caption = "Operator selectable"
ElseIf temp$ = "I" Then
HightlightLabel.Caption = "Field inherit"
Else
HightlightLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 50, 2)
If temp$ = "CS" Then
ColorLabel.Caption = "Operator selectable"
ElseIf temp$ = "CI" Then
ColorLabel.Caption = "Field inherit"
Else
ColorLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 53, 1)
If temp$ = "^" Then
InsertLabel.Caption = "Insert mode"
Else
InsertLabel.Caption = " "
End If
temp$ = Mid$(OIADataText.Text, 62, 5)
If temp$ = "P-MAL" Then
PrinterLabel.Caption = "Printer makfunction"
ElseIf temp$ = "P-PRN" Then
PrinterLabel.Caption = "Printer printing"
ElseIf temp$ = "P-ASS" Then
PrinterLabel.Caption = "Printer assignment"
Else
PrinterLabel.Caption = " "
End If
End Sub
Private Sub StartCommand_Click()
On Error GoTo ErrHandler
FunctionComp = True
OldMousePointer = MousePointer
MousePointer = 11 ' Hour Glass Mouse Pointer
DisplayType$ = GetDisplayType$(SessionIdList.Text)
If DisplayType$ = "NONE" Then
MousePointer = OldMousePointer
MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
Exit Sub
End If
Topic$ = GetTopicName()
If Len(Topic$) <= 0 Then
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
MousePointer = OldMousePointer
Exit Sub
End If
Item$ = "OIA"
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
OIADataText.LinkTimeout = -1
OIADataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
OIADataText.LinkItem = Item$
OIADataText.LinkMode = HOT
MousePointer = OldMousePointer
If FunctionComp = True Then
ResultMessageLabel.Visible = True
EndStatus$ = MSG_OK
StartCommand.Enabled = False
StopCommand.Enabled = True
ExitCommand.Enabled = False
Else
ResultMessageLabel.Visible = False
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Start Session Advise (OIA) : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """""" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
UpdateLog
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub StopCommand_Click()
On Error GoTo StopErrHandler
FunctionComp = True
OIADataText.LinkTimeout = -1
OIADataText.LinkMode = NONE
If FunctionComp = True Then
ResultMessageLabel.Visible = False
EndStatus$ = MSG_OK
StopCommand.Enabled = False
StartCommand.Enabled = True
ExitCommand.Enabled = True
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
LogData$(LogEnd) = Time$ + ":Stop Session Advise (OIA) : " + EndStatus$ + Chr$(13) + Chr$(10)
UpdateLogPointer
UpdateLog
Exit Sub
StopErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub TopicCheck_Click()
If TopicCheck.Value = CHECKED Then
UserDefFrame.Enabled = False
UserDefStrText.Enabled = False
Else
UserDefFrame.Enabled = True
UserDefStrText.Enabled = True
End If
TopicLabel.Caption = GetTopicName()
End Sub
Private Sub UpdateLog()
temp$ = " "
If LogTop > LogEnd Then
For i% = LogTop To MAXLOGNUM
temp$ = temp$ + LogData$(i%)
Next
For i% = 0 To LogEnd
temp$ = temp$ + LogData$(i%)
Next
ElseIf LogTop < LogEnd Then
For i% = LogTop To LogEnd
temp$ = temp$ + LogData(i%)
Next
Else
temp$ = LogData(i%)
End If
MainForm.FunctionLog.Text = temp$
Loged = False
End Sub
Private Sub UpdateLogPointer()
LogEnd = LogEnd + 1
If LogEnd = MAXLOGNUM + 1 Then
LogEnd = 0
End If
If LogTop = LogEnd Then
LogTop = LogTop + 1
If LogTop = MAXLOGNUM + 1 Then
LogTop = 0
End If
End If
End Sub
Private Sub UserDefStrText_Change()
TopicLabel.Caption = GetTopicName()
End Sub