Information générale
Catégorie:
Codage, syntaxe et commandes
John - this is pretty wide open.
You remember C++ templates for overloading?
You can accomplish something similar, based on your lparameters coming in.
1. you can pass different parameter types, and then check for both # of parameters and type() of parameters. a case statement comes to mind.
2. think about passing an object? then check for properties of the object.
whilst this way requires more thinking and overhead - the implementation and runtime eval is a bit more straightforward. you can even call methods in that object that are specific to the object..
3. Chris recommended an array - have u thought about that?
mondo regards [Bill]
>Hi,
>I have a function that need to have overload feature. Since VFP doesn;t support overload, how could I implement it?
>
>Print(cText, cAlighment)
>Print(cText1, cText2, ....)
>
>Any suggestion?
>
>Thank you
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement