Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters to a function
Message
 
 
À
05/12/2008 05:07:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01365569
Message ID:
01365628
Vues:
22
>
>Your method looks like:
>
>procedure OpenForm( m.tcClassName, m.tcClasslib, m.tuParm1, m.tuParm2, m.tuParm3 )
>local lnParameters, objForm
>lnParameters = pcount()
>do case
>  case m.lnParameters = 0
>    objForm = NEWOBJECT( m.tcClassName, m.tcClassLib)
>  case m.lnParameters = 1
>    objForm = NEWOBJECT( m.tcClassName, m.tcClassLib, '', m.tuParm1)
>  case m.lnParameters = 2
>    objForm = NEWOBJECT( m.tcClassName, m.tcClassLib, '', m.tuParm1, m.tuParm2)
>  case m.lnParameters = 3
>    objForm = NEWOBJECT( m.tcClassName, m.tcClassLib, '', m.tuParm1, m.tuParm2, m.tuParm3 )
>endcase
>
>Where is the problem?
>
>Cetin

There is absolutely no problem with your code - this is pretty much what I thought too. But I was concerned that this was not the most, how do I put it, "professional" approach. And since you recommend it (and I have the highest regard for your technical expertise), this approach is good now. Although I will try the parameter object also recommended in this thread.

Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform