Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setfocus() vs Setfocus
Message
De
13/11/1999 10:48:27
 
 
À
13/11/1999 08:37:21
Loren Fedje
Loren D. Fedje & Associates Ltd.
Chilliwack, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00290908
Message ID:
00290927
Vues:
13
>I have seen that in most of the code that I have read, Setfocus and Refresh are always followed by (). In my code I have not used the brackets and all works fine. Is it just a standard rule to use the brackes or am I going to run into problems later by writing sloppy code?
>
>Thanks

As you've learned, the parens are usually optional. But, if you need to get a return value from the method you are calling, they are required:

lnValue = THISFORM.MyMethod

Gives you a "property not found" error

lnValue = THISFORM.MyMethod()

Works.

What's more, including the parens in every function call is just good coding practice. Later on, after having written a ton of VFP code and having to maintain it, you'll appreciate the visual clue as to what the code is doing.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform