VERSION 4.00 Begin VB.Form frm_COBOL Appearance = 0 'フラット BackColor = &H00C0C0C0& BorderStyle = 1 '固定(実線) Caption = "Micro Focus VB calling COBOL demo" ClientHeight = 5595 ClientLeft = 1050 ClientTop = 2460 ClientWidth = 7155 ClipControls = 0 'False ControlBox = 0 'False BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 6000 Left = 990 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 5595 ScaleWidth = 7155 Top = 2115 Width = 7275 Begin VB.CommandButton BtnAbout Appearance = 0 'フラット BackColor = &H80000005& Caption = "About" Height = 372 Left = 5760 TabIndex = 2 Top = 1920 Width = 972 End Begin VB.CommandButton BtnClose Appearance = 0 'フラット BackColor = &H80000005& Caption = "Close" Height = 372 Left = 5760 TabIndex = 3 Top = 1200 Width = 972 End Begin VB.CommandButton BtnOk Appearance = 0 'フラット BackColor = &H00404040& Caption = "OK" Default = -1 'True Height = 372 Left = 5760 TabIndex = 1 Top = 480 Width = 972 End Begin VB.Frame Frame2 Appearance = 0 'フラット BackColor = &H00C0C0C0& Caption = "Output Details" ForeColor = &H80000008& Height = 2532 Left = 360 TabIndex = 4 Top = 2760 Width = 5652 Begin VB.Label lbl_message_out Caption = "Not used yet" Height = 255 Left = 1320 TabIndex = 26 Top = 2160 Width = 4215 End Begin VB.Label lbl_message Caption = "Message" Height = 255 Left = 240 TabIndex = 25 Top = 2160 Width = 975 End Begin VB.Label lbl_double_out Height = 255 Left = 1320 TabIndex = 24 Top = 1800 Width = 4095 End Begin VB.Label lbl_single_out Height = 255 Left = 1320 TabIndex = 23 Top = 1440 Width = 3975 End Begin VB.Label lbl_long_out Height = 255 Left = 1320 TabIndex = 22 Top = 1080 Width = 4095 End Begin VB.Label lbl_integer_out Height = 255 Left = 1320 TabIndex = 21 Top = 720 Width = 4095 End Begin VB.Label lbl_string_40_out BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS 明朝" Size = 8.25 Charset = 128 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 1320 TabIndex = 20 Top = 360 Width = 3855 End Begin VB.Label Label5 Caption = "Double" Height = 255 Left = 240 TabIndex = 19 Top = 1800 Width = 855 End Begin VB.Label Label4 Caption = "Single" Height = 255 Left = 240 TabIndex = 18 Top = 1440 Width = 735 End Begin VB.Label Label3 Caption = "Long" Height = 255 Left = 240 TabIndex = 17 Top = 1080 Width = 855 End Begin VB.Label Label2 Caption = "Integer" Height = 255 Left = 240 TabIndex = 16 Top = 720 Width = 855 End Begin VB.Label Label1 Caption = "String(40)" Height = 255 Left = 240 TabIndex = 15 Top = 360 Width = 1095 End End Begin VB.Frame Frame1 Appearance = 0 'フラット BackColor = &H00C0C0C0& Caption = "Input Details" ForeColor = &H80000008& Height = 2175 Left = 360 TabIndex = 0 Top = 240 Width = 5175 Begin VB.TextBox txt_double Height = 285 Left = 1200 TabIndex = 14 Text = "0.09876543210987654321" Top = 1680 Width = 3615 End Begin VB.TextBox txt_Single Height = 285 Left = 1200 TabIndex = 12 Text = "0.12345678901234567890" Top = 1320 Width = 3615 End Begin VB.TextBox Txt_Long Height = 285 Left = 1200 TabIndex = 10 Text = "123456789" Top = 960 Width = 3615 End Begin VB.TextBox Txt_Integer Height = 285 Left = 1200 TabIndex = 8 Text = "1234" Top = 600 Width = 3615 End Begin VB.TextBox Txt_string_40 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS 明朝" Size = 8.25 Charset = 128 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1200 TabIndex = 6 Text = "This is the text to pass to COBOL" Top = 240 Width = 3615 End Begin VB.Label lbl_double Caption = "Double" Height = 255 Left = 240 TabIndex = 13 Top = 1680 Width = 735 End Begin VB.Label lbl_Single Caption = "Single" Height = 255 Left = 240 TabIndex = 11 Top = 1320 Width = 855 End Begin VB.Label lbl_Long Caption = "Long" Height = 255 Left = 240 TabIndex = 9 Top = 960 Width = 735 End Begin VB.Label lbl_Integer Caption = "Integer" Height = 255 Left = 240 TabIndex = 7 Top = 600 Width = 735 End Begin VB.Label Lbl_String_40 Caption = "String (40)" Height = 255 Left = 240 TabIndex = 5 Top = 240 Width = 1095 End End End Attribute VB_Name = "frm_COBOL" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit Dim CaptionText1 As Variant Dim CaptionText2 As Variant Dim CaptionText3 As Variant Dim CaptionText4 As Variant Dim CaptionText5 As Variant Private Sub BtnAbout_Click() ' All the CaptionTextn string variables below are concatenated together with the appropriate ' line feed characters to display text in the About dialog. CaptionText1 = "This Application Proves the concept of Visual Basic v4.00 calling a Micro Focus COBOL v4.0.26 DLL." CaptionText2 = "The demo application uses a COBOL program to return the input values and a message." CaptionText3 = "This Visual Basic 4.0 application was written by Jim Eales March 1997....version 1.0.1." CaptionText4 = " " CaptionText5 = " " frmAbout!lblAbout.Caption = CaptionText1 & Chr$(10) & Chr$(10) & CaptionText2 & Chr$(10) & Chr$(10) & CaptionText3 & CaptionText4 & Chr$(10) & Chr$(10) & CaptionText5 ' The Show method with style = 1 is used here to display the dialog as modal. Unloading the ' dialog is handled in the forms cmdOK_Click event procedure. frmAbout.Show 1 End Sub Private Sub BtnClose_Click() End End Sub Private Sub BtnOk_Click() Dim Valid As Integer Valid = 0 'Validate the input given If Len(txt_string_40.Text) > 40 Then MsgBox "Text should not be more than 40 characters.", 48, "MF Demo" Else 'valid date Valid = 1 End If If Valid = 0 Then txt_string_40.SetFocus txt_string_40.SelStart = 0 txt_string_40.SelLength = Len(txt_string_40.Text) Exit Sub End If Valid = 0 If IsNumeric(Txt_Integer.Text) Then If Txt_Integer.Text > 9999 Then MsgBox "Invalid Integer - must be 9,999 or less.", 48, "MF Demo" ElseIf Txt_Integer.Text < -9999 Then MsgBox "Invalid Integer - must be -9,999 or more.", 48, "MF Demo" Else 'valid life cover Valid = 1 End If Else ' not a number MsgBox "Invalid Integer - must be a number between -9,999 and 9,999.", 48, "MF Demo" End If If Valid = 0 Then Txt_Integer.SetFocus Txt_Integer.SelStart = 0 Txt_Integer.SelLength = Len(Txt_Integer.Text) Exit Sub End If Valid = 0 If IsNumeric(Txt_Long.Text) Then If Txt_Long.Text > 999999999 Then MsgBox "Invalid Long - must be 999,999,999 or less.", 48, "MF Demo" ElseIf Txt_Long.Text < -999999999 Then MsgBox "Invalid Long - must be -999,999,999 or more.", 48, "MF Demo" Else 'valid life cover Valid = 1 End If Else ' not a number MsgBox "Invalid Long - must be a number between -999,999,999 and 999,999,999.", 48, "MF Demo" End If If Valid = 0 Then Txt_Long.SetFocus Txt_Long.SelStart = 0 Txt_Long.SelLength = Len(Txt_Long.Text) Exit Sub End If CallInterface.String_40 = txt_string_40.Text CallInterface.Integer = Txt_Integer.Text CallInterface.String_40A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CallInterface.Long = Txt_Long.Text CallInterface.String_40B = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CallInterface.single = txt_Single.Text CallInterface.String_40C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CallInterface.double = txt_double.Text CallInterface.String_40D = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Call_COBOL_DLL lbl_message_out = CallInterface.message_out lbl_string_40_out = CallInterface.String_40_out lbl_integer_out = CallInterface.Integer lbl_long_out = CallInterface.Long lbl_single_out = CallInterface.single lbl_double_out = CallInterface.double End Sub