Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is a 'warper program'?
Message
De
27/11/1999 00:16:18
 
 
À
26/11/1999 22:35:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00295884
Message ID:
00295912
Vues:
18
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform