home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fsesexxf.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
13KB
|
428 lines
VERSION 4.00
Begin VB.Form FormSessExMacroXfer
Caption = "File transfer"
ClientHeight = 4104
ClientLeft = 3144
ClientTop = 2652
ClientWidth = 6024
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 = 4428
Left = 3096
LinkMode = 1 'Source
LinkTopic = "Form2"
ScaleHeight = 4104
ScaleWidth = 6024
Top = 2376
Width = 6120
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FSESEXXF.frx":0000
Left = 1320
List = "FSESEXXF.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 480
Width = 492
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 4200
TabIndex = 18
Top = 3600
Width = 852
End
Begin VB.CommandButton Execute
Caption = "&Execute"
Default = -1 'True
Height = 372
Left = 960
TabIndex = 17
Top = 3600
Width = 852
End
Begin VB.TextBox OptionText
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 492
Left = 3240
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 16
Text = "FSESEXXF.frx":00A4
Top = 2760
Width = 2292
End
Begin VB.Frame HostTypeFrame
Caption = "Host type"
ForeColor = &H80000008&
Height = 612
Left = 3000
TabIndex = 6
Top = 840
Width = 2604
Begin VB.OptionButton CICSOption
Caption = "&CICS"
ForeColor = &H80000008&
Height = 252
Left = 1728
TabIndex = 9
Top = 240
Width = 780
End
Begin VB.OptionButton VMOption
Caption = "&VM"
ForeColor = &H80000008&
Height = 255
Left = 960
TabIndex = 8
Top = 240
Value = -1 'True
Width = 735
End
Begin VB.OptionButton MVSOption
Caption = "&MVS"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 7
Top = 240
Width = 780
End
End
Begin VB.TextBox HOSTfileText
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 492
Left = 480
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 14
Top = 2760
Width = 2292
End
Begin VB.Frame Frame1
Caption = "Xfer type"
ForeColor = &H80000008&
Height = 612
Left = 312
TabIndex = 3
Top = 840
Width = 2604
Begin VB.OptionButton ReceiveOption
Caption = "&Receive"
ForeColor = &H80000008&
Height = 252
Left = 960
TabIndex = 5
Top = 240
Width = 1164
End
Begin VB.OptionButton SendOption
Caption = "&Send"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 4
Top = 240
Value = -1 'True
Width = 780
End
End
Begin VB.TextBox PCfileText
BackColor = &H00FFFFC0&
BeginProperty Font
name = "System"
charset = 0
weight = 700
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 492
Left = 480
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 11
Top = 1800
Width = 3972
End
Begin VB.TextBox DataText
BackColor = &H00C0FFFF&
Height = 288
Left = 2880
TabIndex = 19
Top = 3720
Visible = 0 'False
Width = 204
End
Begin VB.Frame Frame2
Caption = "&PC File Name"
Height = 852
Left = 360
TabIndex = 10
Top = 1560
Width = 5292
Begin VB.CommandButton BrowseCommand
Caption = "&Browse"
Height = 492
Left = 4200
TabIndex = 12
Top = 240
Width = 972
End
End
Begin VB.Frame Frame3
Caption = "&Host File Name"
Height = 852
Left = 360
TabIndex = 13
Top = 2520
Width = 2532
End
Begin VB.Frame Frame4
Caption = "&Options"
Height = 852
Left = 3120
TabIndex = 15
Top = 2520
Width = 2532
End
Begin VB.Frame Frame5
Caption = "Input Parameters"
Height = 3372
Left = 120
TabIndex = 0
Top = 120
Width = 5772
Begin VB.OptionButton AS400Option
Caption = "AS/400"
Height = 252
Left = 4200
TabIndex = 21
Top = 360
Width = 1212
End
Begin VB.OptionButton A390Option
Caption = "A/390"
Height = 252
Left = 2880
TabIndex = 20
Top = 360
Value = -1 'True
Width = 1332
End
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 240
TabIndex = 1
Top = 360
Width = 972
End
End
Begin MSComDlg.CommonDialog BrowsePCFileDialog
Left = 3480
Top = 3600
_Version = 65536
_ExtentX = 677
_ExtentY = 677
_StockProps = 0
End
End
Attribute VB_Name = "FormSessExMacroXfer"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub A390Option_Click()
HostTypeFrame.Enabled = True
MVSOption.Enabled = True
VMOption.Enabled = True
CICSOption.Enabled = True
End Sub
Private Sub AS400Option_Click()
HostTypeFrame.Enabled = False
MVSOption.Enabled = False
VMOption.Enabled = False
CICSOption.Enabled = False
End Sub
Private Sub BrowseCommand_Click()
On Error GoTo BrowseErrorHandler
BrowsePCFileDialog.Filter = "All Files (*.*)|*.*"
BrowsePCFileDialog.FilterIndex = 1
BrowsePCFileDialog.CancelError = True
If SendOption.Value = True Then
BrowsePCFileDialog.DialogTitle = "Choose PC file to Send"
BrowsePCFileDialog.Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNFileMustExist Or cdlOFNLongNames
BrowsePCFileDialog.ShowOpen
Else ' ReceiveOption.Value = True
BrowsePCFileDialog.DialogTitle = "Choose PC file name for file being received"
BrowsePCFileDialog.Flags = cdlOFNOverwritePrompt Or cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames
BrowsePCFileDialog.ShowSave
End If
PCfileText.Text = BrowsePCFileDialog.filename
Exit Sub
BrowseErrorHandler:
If Err = 32755 Then
' User Canceled Save As Dialog
Else
MsgBox "Error Number " & Err & " while Browsing for PC file name."
End If
End Sub
Private Sub Execute_Click()
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
temp$ = LTrim$(RTrim$(SessionIdList.Text))
If Len(temp$) > 0 Then
Topic$ = "Session" + SessionIdList.Text
Else
MousePointer = OldMousePointer
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
Exit Sub
End If
CommandString$ = GetSessExXferData()
On Error GoTo ErrHandler
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
DataText.LinkTimeout = -1
DataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
DataText.LinkMode = COLD
DataText.LinkExecute CommandString$
DataText.LinkMode = NONE
MousePointer = OldMousePointer
If FunctionComp = True Then
MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
EndStatus$ = MSG_OK
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Session Execute Macro : " + 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$ + "Command = " + """" + CommandString$ + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub ExitDlg_Click()
Hide
End Sub
Private Sub Form_Load()
SessionIdList.ListIndex = 0
OptionText.Text = "ASCII CRLF"
AdjustForNT351 FormSessExMacroXfer
End Sub
Private Function GetSessExXferData() As String
Dim HostType As String
If SendOption.Value = True Then
XferType$ = "SEND"
Else
XferType$ = "RECEIVE"
End If
If A390Option.Value = True Then
If MVSOption.Value = True Then
HostType = "MVS"
ElseIf VMOption.Value = True Then
HostType = "VM"
Else
HostType = "CICS"
End If
End If
temp$ = RTrim$(LTrim$(PCfileText.Text))
If Left$(temp$, 1) = """" Then
PCfile$ = temp$
Else
PCfile$ = """" + temp$ + """"
End If
temp$ = RTrim$(LTrim$(HOSTfileText.Text))
If Left$(temp$, 1) = """" Then
HOSTfile$ = temp$
Else
HOSTfile$ = """" + temp$ + """"
End If
temp$ = RTrim$(LTrim$(OptionText.Text))
If Left$(temp$, 1) = """" Then
OptionData$ = Mid$(temp$, 2, Len(temp$) - 2)
Else
OptionData$ = temp$
End If
temp$ = RTrim$(LTrim$(OptionData$))
If (Left$(temp$, 3) <> "MVS") And (Left$(temp$, 2) <> "VM") And (Left$(temp$, 4) <> "CICS") Then
OptionData$ = """" + HostType + " " + OptionData$ + """"
Else
OptionData$ = """" + OptionData$ + """"
End If
GetSessExXferData = "[" + XferType$ + "(" + PCfile$ + ", " + HOSTfile$ + ", " + OptionData$ + ")]"
End Function
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