Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing file handle as parameter?
Message
De
28/01/2005 04:41:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows '98
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
00981603
Message ID:
00981634
Vues:
43
>Is there any reason to not pass file handles as parameters to methods?
>
>I have a class that formats data into html...
>
>
>=fwrite(f,htmlformat.td(table.field))
>
>
>This writes
'<td>My Data</td>'
to file handle f.
>
>I could save a lot of coding if it is an ok practice to pass the file handle. Therefore it would become...
>
>
>htmlformat.td(f,table.field)
>
>
>...with the fwrite happening in the method.

I would say the later approach is better. Or, if you would have this as an object, you could define a property nHandle and only initialize it once.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform