Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calulated ControlSource
Message
De
13/08/2001 13:57:02
 
 
À
13/08/2001 13:38:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00543139
Message ID:
00543151
Vues:
20
>Hi!
>
>I am having trouble creating a Calulated ControlSource for a TextBox on a Form.
>
>When I specify an expression as the ControlSource of the TextBox I get an error "The data source for this object must be a variable reference"
>
>e.g. ThisForm.TxtFileName.ControlSource = "juststem(filename) + '.'+ justext(filename)" where filename is a memo field.
>
>I have tried a few different ways but none of them seem to work.

VFP seems to choke if expressions for ControlSource gets too complex. Just how complex is too complex, I've never figured out.

One way to get around it is to use a UDF:
ThisForm.TxtFileName.ControlSource = "MyUDF(filename)"

FUNCTION MyUDF
LPARAMETERS tcFileName

RETURN juststem(tcfilename) + '.'+ justext(tcfilename)
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform