home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Cobol 24 Hours
/
Sams_Cobol_24_Hours.iso
/
Cobol32
/
PowerOCX
/
bsrtocx.z
/
sample2.frm
< prev
next >
Wrap
Text File
|
1997-05-14
|
12KB
|
401 lines
VERSION 4.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "PowerBSORT OCX Sample"
ClientHeight = 4845
ClientLeft = 1665
ClientTop = 2610
ClientWidth = 5640
Height = 5250
Icon = "sample2.frx":0000
Left = 1605
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3008.248
ScaleMode = 0 'User
ScaleWidth = 4727.548
Top = 2265
Width = 5760
Begin VB.Frame Frame1
Caption = "Input File"
Height = 1392
Left = 60
TabIndex = 9
Top = 900
Width = 5508
Begin VB.TextBox Text4
Alignment = 1 'Right Justify
Height = 288
HelpContextID = 1380
Left = 1350
TabIndex = 16
Text = "Text4"
Top = 990
Width = 768
End
Begin VB.ComboBox ItypeCombo
Height = 300
HelpContextID = 1350
Left = 1080
Style = 2 'Dropdown List
TabIndex = 14
Top = 630
Width = 4335
End
Begin VB.CommandButton InCommand
Caption = "..."
Height = 255
Left = 5130
TabIndex = 12
Top = 270
Width = 255
End
Begin VB.TextBox Text1
Height = 285
HelpContextID = 1340
Left = 1080
TabIndex = 11
Text = "Text1"
Top = 300
Width = 3975
End
Begin VB.Label la_InputFiles
Caption = "FileNames:"
Height = 255
Left = 120
TabIndex = 10
Top = 270
Width = 855
End
Begin VB.Label la_InputFileType
Caption = "FileType:"
Height = 255
Left = 120
TabIndex = 13
Top = 630
Width = 735
End
Begin VB.Label la_RecordLen
Caption = "Record Length:"
Height = 255
Left = 120
TabIndex = 15
Top = 990
Width = 1335
End
End
Begin VB.Frame Frame2
Caption = "Output File"
Height = 1032
Left = 60
TabIndex = 17
Top = 2340
Width = 5508
Begin VB.TextBox Text2
Height = 288
HelpContextID = 1390
Left = 1080
TabIndex = 19
Text = "Text1"
Top = 240
Width = 3975
End
Begin VB.ComboBox OtypeCombo
Height = 300
HelpContextID = 1400
Left = 1080
Style = 2 'Dropdown List
TabIndex = 22
Top = 600
Width = 4335
End
Begin VB.CommandButton OutCommand1
Caption = "..."
Height = 255
Left = 5130
TabIndex = 20
Top = 240
Width = 255
End
Begin VB.Label la_OutputFile
Caption = "FileName:"
Height = 255
Left = 120
TabIndex = 18
Top = 240
Width = 855
End
Begin VB.Label la_OutputFileType
Caption = "FileType:"
Height = 255
Left = 90
TabIndex = 21
Top = 600
Width = 735
End
End
Begin VB.Frame Frame3
Caption = "Key fields"
Height = 864
Left = 60
TabIndex = 23
Top = 3420
Width = 5508
Begin VB.TextBox Text3
Height = 285
HelpContextID = 1360
Left = 1080
TabIndex = 25
Text = "Text1"
Top = 180
Width = 4335
End
Begin VB.Label la_Keys
Caption = "Keys:"
Height = 255
Left = 120
TabIndex = 24
Top = 240
Width = 735
End
Begin VB.Label Label1
Caption = "Description Form: pos.len typ opt [pos.len typ opt] ..."
Height = 252
Left = 1080
TabIndex = 26
Top = 540
Width = 4092
End
End
Begin VB.Frame Frame4
Caption = "Feature"
Height = 672
HelpContextID = 1240
Left = 60
TabIndex = 0
Top = 120
Width = 3900
Begin VB.OptionButton Opt_Copy
Caption = "Copy"
Height = 312
HelpContextID = 1240
Left = 2460
TabIndex = 3
Top = 240
Width = 972
End
Begin VB.OptionButton Opt_Merge
Caption = "Merge"
Height = 285
HelpContextID = 1240
Left = 1200
TabIndex = 2
Top = 240
Width = 855
End
Begin VB.OptionButton Opt_Sort
Caption = "Sort"
Height = 285
HelpContextID = 1240
Left = 120
TabIndex = 1
Top = 240
Value = -1 'True
Width = 855
End
End
Begin VB.CommandButton Command1
Caption = "OK"
Height = 432
Left = 3060
TabIndex = 28
Top = 4380
Width = 1188
End
Begin VB.CommandButton Command2
Caption = "Cancel"
Height = 432
Left = 4380
TabIndex = 29
Top = 4380
Width = 1188
End
Begin VB.Frame Frame5
Caption = "Return code"
Height = 792
Left = 4080
TabIndex = 4
Top = 60
Width = 1488
Begin VB.Label la_Detail
Caption = "Detail:"
Height = 252
Left = 180
TabIndex = 7
Top = 480
Width = 612
End
Begin VB.Label la_Error
Caption = "Error:"
Height = 252
Left = 180
TabIndex = 5
Top = 240
Width = 612
End
Begin VB.Label la_DetailVal
Caption = "Label4"
Height = 252
Left = 780
TabIndex = 8
Top = 480
Width = 552
End
Begin VB.Label la_ErrorVal
Caption = "Label4"
Height = 252
Left = 780
TabIndex = 6
Top = 240
Width = 552
End
End
Begin PowerBSORT_Lib.PowerBSORT PowerBSORT1
Left = 240
Top = 4350
_Version = 65536
_ExtentX = 741
_ExtentY = 741
_StockProps = 0
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 720
Top = 4320
_ExtentX = 847
_ExtentY = 847
_Version = 327680
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "For Help, press F1"
Height = 192
Left = 120
TabIndex = 27
Top = 4560
Width = 1320
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Const col_BackNormal = &HFFFFFF
Const col_TextNormal = &H0
Const col_BackOK = &HFF0000
Const col_TextOK = &HFFFFFF
Const col_BackErr = &HFF
Const col_TextErr = &HFFFFFF
Private Sub AfterAction()
Dim ErrCode, ErrDetail As Long
Dim col_Back, col_Text As Long
ErrCode = PowerBSORT1.ErrorCode
ErrDetail = PowerBSORT1.ErrorDetail
la_ErrorVal.Caption = CStr(ErrCode)
la_DetailVal.Caption = CStr(ErrDetail)
If ErrCode = 0 Then
col_Back = col_BackOK
col_Text = col_TextOK
Else
col_Back = col_BackErr
col_Text = col_TextErr
End If
la_Error.ForeColor = col_Text
la_Error.BackColor = col_Back
la_ErrorVal.ForeColor = col_Text
la_ErrorVal.BackColor = col_Back
la_Detail.ForeColor = col_Text
la_Detail.BackColor = col_Back
la_DetailVal.ForeColor = col_Text
la_DetailVal.BackColor = col_Back
End Sub
Private Sub BeforeAction()
la_Error.ForeColor = col_TextNormal
la_Error.BackColor = col_BackNormal
la_ErrorVal.ForeColor = col_TextNormal
la_ErrorVal.BackColor = col_BackNormal
la_Detail.ForeColor = col_TextNormal
la_Detail.BackColor = col_BackNormal
la_DetailVal.ForeColor = col_TextNormal
la_DetailVal.BackColor = col_BackNormal
End Sub
Private Sub Command1_Click()
BeforeAction
'--- START ---
PowerBSORT1.InputFiles = Text1.Text
PowerBSORT1.InputFileType = ItypeCombo.ListIndex
PowerBSORT1.OutputFile = Text2.Text
PowerBSORT1.OutputFileType = OtypeCombo.ListIndex
PowerBSORT1.KeyCmdStr = Text3.Text
PowerBSORT1.MaxRecordLength = Val(Text4.Text)
If Opt_Sort.Value = True Then
PowerBSORT1.DisposalNumber = 0
End If
If Opt_Merge.Value = True Then
PowerBSORT1.DisposalNumber = 1
End If
If Opt_Copy.Value = True Then
PowerBSORT1.DisposalNumber = 2
End If
PowerBSORT1.Action
'--- END ---
AfterAction
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
App.HelpFile = "..\..\psocx.hlp"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = 100
la_ErrorVal.Caption = ""
la_DetailVal.Caption = ""
ItypeCombo.AddItem "Text File", 0
ItypeCombo.AddItem "Binary fixed length file", 1
ItypeCombo.AddItem "COBOL85 sequential fixed length file", 2
ItypeCombo.AddItem "COBOL85 sequential variable length file", 3
ItypeCombo.AddItem "COBOL85 relative fixed length file", 4
ItypeCombo.AddItem "COBOL85 relative variable length file", 5
ItypeCombo.ListIndex = 0
OtypeCombo.AddItem "Text File", 0
OtypeCombo.AddItem "Binary file", 1
OtypeCombo.AddItem "COBOL85 sequential file", 2
OtypeCombo.AddItem "COBOL85 relative file", 3
OtypeCombo.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
Private Sub InCommand_Click()
CommonDialog1.FilterIndex = 1
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.filename
End Sub
Private Sub OutCommand1_Click()
CommonDialog1.FilterIndex = 1
CommonDialog1.ShowOpen
Text2.Text = CommonDialog1.filename
End Sub