Compile(, _CWVER_=1000) not Compiling in Clarion 10

I am trying to add a compile statement in Clarion 10.0.12799 and it does not generate the code. The message is not displayed in the Clarion 10 compiled program. I would like the code to be compiled in Clarion 10, but not in Clarion 11. Do I have the syntax wrong?

compile('***C10PDF***', _CWVER_=1000)
    message('this compiles only in C10')
!   '***C10PDF***'

Thanks,
Mark

Edit: I missed the “Not in 11” so the below is wrong for you as it will compile in C 10, 11, 11.1 and newer.

See below Post #7 a similar OMIT that may work.


You can do this … or this is what I know works … but is wrong for your post

compile('***C10PDF***', _C100_)
   Message('this compiles only in C10')
!   '***C10PDF***'

The Help on this has not been updated since 8.0 specifying _C80_ so I extrapolated C10 to _C100_

1 Like

You would need to add another zero to make it 10000. 11 is 11000, and 11.1 is 11100.

2 Likes

That actually would not do what he wants, as he doesn’t want it compiled in C11. That message will appear in C10 and up.

Thanks - I’ll give it a shot tomorrow while watching the video stream from CDIC.

I agree the below works for me in 11.0 so _CWVER_=10000 should work for him.

    compile('***C11.0 PDF***', _CWVER_=11000)
       Message('this compiles only in C11.0')
    !   '***C11.0 PDF***' 

You are correct my post is wrong. I missed his “in Clarion 10, but Not in Clarion 11.”

What may work for you also would be the below OMIT. It would also compile is versions < 10 like 9 and 8 so that is different than your CwVer=10. This may be desirable that code is for C10 and before. This is more of an issue with Class writers supporting with all versions since C8.

OMIT('***C10PDF***', _C110_)    !was Compile(, _CWVER_=10000)
    Message('this compiles only in C10 and  C9 C8, but not C11 C12 ...')
!   '***C10PDF***'

In C10 the C11 symbol _C110_ would be be Undefined. OMIT’s rules say that Undefined Symbols are assumed to be Zero.

The OMIT directive executes only if the expression is true. Therefore, the code between OMIT and the terminator is compiled only if the expression is not true. If the expression contains an EQUATE that has not yet been defined, then the referenced EQUATE is assumed to be zero (0).

image

The statement
compile('***C10PDF***', _CWVER_=10000)

Worked in Clarion 10. Hoping to get the Clarion 11 compile working early next week after CIDC when I have more time available. I’ll update then.

Thanks.

Got it working in Clarion 11.1, so I can seamlessly have some code I need for Clarion 10, and other code I need in Clarion 11. Hopefully the upgrade for our users is seamless also.

1 Like