Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing file handle as parameter?
Message
From
28/01/2005 04:41:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows '98
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981603
Message ID:
00981634
Views:
45
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform