cavowed.inf and /vo15 option being OFF (treat missing types as usual)

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

cavowed.inf and /vo15 option being OFF (treat missing types as usual)

Post 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
2021-04-25_22-30-25.png (233.12 KiB) Viewed 417 times
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

cavowed.inf and /vo15 option being OFF (treat missing types as usual)

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

cavowed.inf and /vo15 option being OFF (treat missing types as usual)

Post 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! :)
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

cavowed.inf and /vo15 option being OFF (treat missing types as usual)

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply