Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is a 'warper program'?
Message
From
27/11/1999 00:16:18
 
 
To
26/11/1999 22:35:31
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00295884
Message ID:
00295912
Views:
19
>I've seen this phrase used a few times. Can someone explain what it means?

I wrapper is some code that makes things easier (faster to code and quicker to understand). Instead of PRG's, wrappers became more popular with an Object interface, particulary (but not only) non-visual classes.

An example you say? Say when ever you want o open a table exclusivly, you don't want an error if it fails, just a return value. So you write a reusable wrapper for the use statement:
*UseEx.Prg
lparam tcFile
local lcError

lcError = on('Error')
on error *

if file(forceext(tcFile, 'dbf'))
   use (tcFile) in 0 excl
endif

on error &lcError

return used(juststem(tcFile))
Then to use a file exclusivly and store its success to a variable, do:

llOpen = UseEx('table1')

There, now you have "wrapped" the use statement.
Previous
Reply
Map
View

Click here to load this message in the networking platform