Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple procedures vs. one procedure - revisited
Message
De
10/06/2005 20:16:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/06/2005 14:07:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01022173
Message ID:
01022376
Vues:
12
>>Everything added to set procedure list! Order is important, worse having multiple procedures open at same time there is no way to call a procedure from one of them selectively (I don't know at least - unless you use "do ... in ..." ). You better use classes.
>
>But the class definitions are searched along the same set proc list <g>...
>Clean coding practices or high attention are necessary when dealing whith duplicate names,
>regardless of them being class names or function names.
>
>But it is a nice dirty way to overwrite functions if you know what you are doing
>
>regards
>
>thomas

Thomas,
Not exactly. I don't say use 'set proc' anywhere. You can control which one you want if it's class based. ie:
FinCalc = NewObject("Calculator","Financial.prg")
SciCalc = NewObject("Calculator","Scientific.prg")

FinCalc.Calculate()
SciCalc.Calculate()
As you can see both classes have the same name and even the same methods they're distinguishable by their prg ( I somewhat find it like namespaces in C# ).

If it was not class based:
set procedure to Financial.prg, Scientific.prg
Calculate()
Would always be Financial calculation.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform