COBOL2002 ユーザーズガイド
Visual BasicプログラムからCOBOLプログラムへ引数を渡す方法を,次に示します。
Private Declare Sub COBSUB Lib "SAMPLE1" _
Alias "_SAMPLE1@12" _
(ByVal a As Integer, _
ByRef a As Integer, _
ByRef a As UserDef)
Private Declare Sub CBLGINT Lib "CBL85RT" Alias "_CBLGINT@0" ()
Private Declare Sub CBLEND Lib "CBL85RT" Alias "_CBLEND@0" ()
Dim PARM1 As Integer
Dim PARM2 As Integer
Private Type UserDef
U_INT1 As Integer
U_INT2 As Integer
End Type
Dim PARM3 As UserDef
Private Sub Command1_Click()
:
Call SAMPLE1(PARM1, PARM2, PARM3)
:
End Sub
Private Sub Form_Load()
:
Call CBLGINT
:
End Sub
Private Sub Form_Unload(Cancel As Integer)
:
Call CBLEND
:
End Sub IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE1.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 L-PARM1 PIC S9(04) USAGE COMP.
01 L-PARM2 PIC S9(04) USAGE COMP.
01 L-PARM3.
02 U-INT1 PIC S9(04) USAGE COMP.
02 U-INT2 PIC S9(04) USAGE COMP.
PROCEDURE DIVISION USING BY VALUE L-PARM1
BY REFERENCE L-PARM2
BY REFERENCE L-PARM3.
ADD 100 TO L-PARM1.
ADD 100 TO L-PARM2.
ADD 100 TO U-INT1.
ADD 100 TO U-INT2.
EXIT PROGRAM.All Rights Reserved. Copyright (C) 2013, 2016, Hitachi, Ltd.
All Rights Reserved. Copyright (C) 2002, 2011, Microsoft Corporation.