Я получил ошибку при запуске программы Cobol в Micro Focus Cobol Eclipse. Не знаю, почему это произошло. Пожалуйста, помогите мне, поскольку я должен представить это как часть моей большой домашней работы завтра.
Другой вопрос, если возможно, пожалуйста, помогите мне с переменной, я помещаю ее в раздел локального хранилища. например, в Java я хочу установить его как глобальный для каждого метода, чтобы получить доступ?
Контрольный файл:
Identification Division.
Program-Id. Client.
Environment Division.
Configuration Section.
Repository.
Class Student.
Data Division.
Working-Storage Section.
01 H object reference Student.
Procedure Division.
display "goodbye goodbye".
Invoke Student "new" returning H.
Invoke H "sayHello".
Invoke H "GetAverage" .
Invoke H "Grading".
Exit Program.
End Program Client.
Вот файл класса:
class-id. Student data is protected
* inherits from base with data
inherits Base.
object section.
class-control.
Student is class "student"
base is class "base"
.
working-storage section.
class-object.
object-storage section.
Method-Id. sayHello.
Procedure Division.
Display "Hello World!".
* Display "I'm hello".
End Method sayHello.
*Method1
method-id. "GetAverage".
local-storage section.
linkage section.
01 English pic 99 value 9.
01 Math pic 99 value 5.
01 AverMark pic 99 value 3.
procedure division using by reference English,
by reference Math.
* returning AverMark.
COMPUTE AverMark = (English+Math)/2
Display "Average mark is ", AverMark.
Accept English.
exit method.
end method "GetAverage".
*Method2
method-id. "Grading"
local-storage section.
linkage section.
01 AverMark pic 9.
01 Grade pic X.
procedure division using by reference AverMark.
* returning Grade.
IF AverMark < 5
MOVE "FAIL" TO Grade
ELSE
MOVE "PASS" TO Grade.
exit method.
end method "Grading".
end class-object.
end class Student.
Результат:
до свидания до свидания
Ошибка выполнения: файл «Клиент»
код ошибки: 243, pc = 0, call = 1, seg = 0
243 Текст сообщения об ошибке не найден