質問

I'm working on a visual basic 6 and we have product made of VB6 modules that use each other. Every module has it's own exe.

I'm having a problem when I'm referring to one function in one module, which works, and in another module it doesn't.

For instance, in one module I'm calling the original VB6 Round function which takes following params:

Round(number,0)

But in another module there's a function defined as

Function Round(ByVal X As Variant) As Variant

That should be called as

Round(number)

And that causes a compile time error and it says that function call has a wrong number of parameters, while on other modules where this function is undefined there are no errors.

Now, I could use it, but there are other places where I actually need to specify decimal point precision where I call it as

Round(number,2)
Round(number,3)

etc.

How do I disambiguate between these functions to call only and ONLY the original VB6 rounding function?

役に立ちましたか?

解決

I would recommend to avoid such ambiguities by choosing better names for your methods. If you can´t change the method name you can use the full qualified name of the function.

VBA.Math.Round number, 2
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top