Evaluating conditions in Immediate Window fails in native

0 Likes
over 1 year ago

Problem

Evaluating a condition ("A-DATA-ITEM NOT = ZERO" or "? 1 = 2") in the Immediate Window works in managed, but it fails with the following in native:

Unable to evaluate the expression. Not implemented The expression cannot be evaluated while in run mode.

Solution

The Immediate Window is not supported in native code, and there are other ways of querying values, i.e. the Watch List, QuickBrowse, etc.

The expressions such as "A-DATA-ITEM NOT = ZERO" or "? 1 = 2" work in managed code and return TRUE or FALSE.

As for native code, the Watch List or Quick Browse should be used instead, so the value will be displayed when entering the name of a data item, but not anything beyond that. For anything else, an error message will be displayed, but the debugger will continue to run normally.

However, an enhancement to the compiler has been made in Visual COBOL 6.0, which enables some additional functionality when debugging.

For example:

1 a pic 999 value 2. 1 b pic xxxx comp-x value 3. 1 xyz value "abc".


Watch List:

a b * 1 : 5 a function max(10,20) : 25 function upper-case(xyz) : ABC 1 10 : 11 function hex-of(b) : 03000000


Allowed:

  • Normal numeric arithmetic expression with intrinsic functions
  • Single use of alphanumeric intrinsic functions.

Not supported:

  • Logical operators b-and, b-or, etc.
  • ISO2002 user defined methods
  • Inline method invokes
  • Intrinsic functions which are evaluated at compile time
Comment List
Anonymous
Related Discussions
Recommended