Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2800

Re: Two Classes Referencing each Other's Constants

$
0
0

I was hoping that someone would know right away if there was a reason why you can't have mutually dependent public headers.

 

The syntax error is pretty generic.  Here is more detail:

 

I have two classes that I'll refer to as A and B.

 

Check on A passes.

Check on B fails with the following syntax error:

 

Class A, Public Section

Field "CO_STATUS_NEW" is unknown.  It is neither in one of the specified tables nor defined by a "DATA" statement. .

 

Note that the error is referencing class A, even though class A itself passes a check.  Double clicking the error specifically points to a reference in the public header of class A to the co_status_new attribute of class B.

 

There is a co_status_new constant in both class A and class B.  The definition in class A uses the value defined in class B, like so:

 

constants co_status_new type char01 value B=>co_status_new.

 

Class B has a different constant in its public header whose value is defined based on class A like so:

 

class A definition load.

constants co_relid type indx_relid value A=>co_relid.

 

Both of these classes are active, by the way, but I can't re-activate B, due to this syntax error.


Viewing all articles
Browse latest Browse all 2800

Trending Articles