Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus() vs Setfocus
Message
From
13/11/1999 10:48:27
 
 
To
13/11/1999 08:37:21
Loren Fedje
Loren D. Fedje & Associates Ltd.
Chilliwack, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00290908
Message ID:
00290927
Views:
15
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform