Page 1 of 1
cavowed.inf and /vo15 option being OFF (treat missing types as usual)
Posted: Sun Apr 25, 2021 7:36 pm
by Serggio
I'd like to switch off /vo15 option (treat missing types as usual) so that it would be an error if there is a local variable without strictly defined type. I found that this option demands clipper functions to have CLIPPER calling convention to be defined explicitly and return-type is obligative, and it's ok.
But the problem is with VO-style legacy forms, especially with constructors.
For example, in the sample VO SDI project there is the "PropertiesCavowed.inf" file which is the template for autogenerated code. I want it to generate form's contructors as such:
Code: Select all
CONSTRUCTOR(oParent,uExtra) CLIPPER
so that there's just the keyword CLIPPER appended. And I cannot find the way to do it.
I tried this (on the screenshot) and the effect is zero to none: the window editor ignores my setting. At the same time, changes to cavowed.tpl are applied, but constructors are not defined there.
- 2021-04-25_22-30-25.png (233.12 KiB) Viewed 414 times
cavowed.inf and /vo15 option being OFF (treat missing types as usual)
Posted: Sun Apr 25, 2021 10:54 pm
by Chris
Hi Sergio,
I checked what VO does, and I see that it indeed applies the CLIPPER keyword (and any other text after the parameters) in the generated Init. But it somehow ignores it, when generating the PostInit() and PreInit() methods! Probably uses only up to the closing ")" in this case.
I will adjust the code generation in X#, so it will work exactly the same way as in VO, so it should do what you need, except for PostInit/PreInit for which you'll need to make manual adjustments (only the first time they are created).
Btw, there's also another way to prevent the errors for specific methods/entities, you can use a #pragma options directive like that:
Code: Select all
#pragma options ("vo15", on)
METHOD DontReportErrorsForThisMethod(a,b)
RETURN NIL
#pragma options ("vo15", default)
Maybe you'll find also this useful in some cases.
cavowed.inf and /vo15 option being OFF (treat missing types as usual)
Posted: Mon Apr 26, 2021 5:36 am
by Serggio
Chris wrote:But it somehow ignores it, when generating the PostInit() and PreInit() methods
These methods, as well as event handlers, etc. can be adjusted with cavowed.tpl (in X#) and it works fine!
Chris wrote:I will adjust the code generation in X#
Thank you, Chris. That would be great!
cavowed.inf and /vo15 option being OFF (treat missing types as usual)
Posted: Mon Apr 26, 2021 8:28 am
by Chris
Hi Sergio,
Serggio wrote:Chris wrote:But it somehow ignores it, when generating the PostInit() and PreInit() methods
These methods, as well as event handlers, etc. can be adjusted with cavowed.tpl (in X#) and it works fine!
Yeah, it's just that PostInit is defined there as:
[PostInit]
method PostInit(%INITPARAMS%) class %FORM:NAME%
...
So the PostInit parameters are still taken from the InitMethod entry in cavowed.inf and replaced into the %INITPARAMS% macro. But apparently in this case VO (for preinit/postinit) ignores everything outside the parens in this entry (which makes sense). Till now the VOWED in X# was doing the same thing for all Init/PreInit/PostInit, but as you pointed out Init apparently needs special treatment.