Hi ,
I have a Windows form from which i accept a number and on the button click event , i take that number and call cobol program to validate the input.
I am getting error while running the application "114 Attempt to access item beyond bounds of memory".
Windows event:
method-id btnSearch_Click final private.
local-storage section.
01 ws-error pic x.
01 ws-input pic x(08).
linkage section.
01 ws-link-data.
05 ws-link-ctrb-no pic 9(08).
05 ws-link-ctrb-name pic x(50).
procedure division using by value sender as object e as type System.EventArgs.
initialize ws-error.
move self::lblContributorXNo::Text to ws-input
call "ValidateContributor" using by value ws-link-data
move "Y" to ws-error
if ws-error = "N" then
*> insert condition code
set lblCOVERNO::Visible to true
set self::lblContributorXNo::Text to self::txtSearch::Text
else
*> insert code
invoke type MessageBox::Show("Invalid Contributor No !!")
end-if
end method.
COBOL program:
program-id. ValidateContributor as "MSGC_online_screen.ValidateContributor".
data division.
working-storage section.
01 WS-ARRAY-CTRBNO pic 9(08) value 10000008.
linkage section.
01 ws-link-data.
05 ws-link-ctrb-no pic 9(08).
05 ws-link-ctrb-name pic x(50).
05 ws-error-flag pic x.
procedure division using by value ws-link-data .
if WS-ARRAY-CTRBNO = ws-link-ctrb-no
move "ZOEB PATRAWALA" to ws-link-ctrb-name
move "N" to ws-error-flag
else
move spaces to ws-link-ctrb-name
move "Y" to ws-error-flag
goback.