Welcome! Log In Create A New Profile

Advanced

Can windev or webdev support override?

Posted by PETER ZHOU 
PETER ZHOU
Can windev or webdev support override?
June 03, 2009 11:56AM
Hi,

Can windev / webdev support override in procedures or functions ?

Thanks & Regards,

PETER ZHOU
Al
Re: Can windev or webdev support override?
June 03, 2009 12:03PM
Hello Peter

Have a look at "Overload" in the Help, maybe that is what you are looking for.

Regards
Al
Fabrice Harari
Re: Can windev or webdev support override?
June 03, 2009 01:18PM
Hi Peter

it depends what you call override...

Can you create a procedure called hadd that will overwrite the standard hadd function? Yes, no problem

Can you create SEVERAL hadd functions with different types of parameters used automatically depending of the parameter used? no!

Best regards

Superdan.pcs.crosspost
Re: Can windev or webdev support override?
June 03, 2009 02:09PM
PETER ZHOU wrote:
> Hi,
> Can windev / webdev support override in procedures or functions ?
> Thanks & Regards,
> PETER ZHOU
>

You can override Windev's buildin functions.
procedure TRACE(param)
return WL.TRACE(param)

You can't override a procedure This wont work :

procedure hello(x is string)

procedure hello(x is int)

hth, björn
Message forwarded from pcsoft.us.windev
Malc
Re: Can windev or webdev support override?
June 03, 2009 06:36PM
Hi Peter

If you use classes, you can override the methods (use VIRTUAL keyword)

Cheers

Malc
Alexandre Leclerc
Re: Can windev or webdev support override?
June 03, 2009 07:21PM
Hi Peter,

And just to add to all the other posts... since your question is wide... here is another answer: no for your general functions but you can imitate the behaviour using different parameters types, or the number of parameters.

Do not "type" your parameters, and use * if required.

PROCEDURE Something(param1,param2,*)

Then with MyParameters..Type (or TypeVar) you can know to type of a parameter and adopt the desired behaviour. And MyParameters..Occurence returns the number of parameters.

Best regards.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: