Highlighted
Absent Member.
Absent Member.
866 views

setting default parm - using MailPriority

Occasionally the compiler doesn't like this piece of code.  I then recompile it and the error goes away.

method-id SetEmailPriority public

procedure division using by value mailPriority as type MailPriority = type MailPriority::Normal.

set self::EmailPriority to mailPriority.

end method.

Tags (1)
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: setting default parm - using MailPriority

Sorry here is the message.

Error 48 COBCH0001 : Undefined error. Inform Technical Support

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: setting default parm - using MailPriority

There does seem to be a bug here, though so far I have not been able to reproduce the error as you describe.  I extended the example to this:

class-id a.

01 EmailPriority type MailPriority static.

method-id main static.

invoke SetEmailPriority

display EmailPriority

end method.

method-id SetEmailPriority public static.

procedure division using by value mailPriority as type MailPriority = type MailPriority::Normal.

set self::EmailPriority to mailPriority.

end method.

end class.

enum-id MailPriority.

78 Normal value 1.

end enum.

When I compile and run this, it displays a value of 0, rather than 'Normal' as expected.  It looks as if the compiler is not working correctly with default parameter values expressed as enum constants.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.