Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use THIS or THISFORM in Form?
Message
From
14/11/2002 15:09:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00722754
Message ID:
00722900
Views:
13
Is your preference for 'ThisForm' just that - a preference? Or do you see an actual advantage over using 'This'. Readability maybe?

Just curious about why people choose one thing over another.

Alan

>Even it this case such an error will be a rare occasion, as most of the control classes will be instantiated in a form anyways, and it will cause an error only if the class is instantiated outside the form. I myself prefer to use "thisform" in form code.
>
>>About the only advantage to 'This' over 'ThisForm' in this instance that I can see would show up if you wanted to move it all to a class. If you did that, then 'ThisForm' would be an error.
>>
>>On the other hand, if you wanted to move the code to another object on the form, the reverse would be true. In general, I feel like 'This' is more portable, so I like it better for that reason. If you aren't considering portability, then I don't see that it makes any difference.
>>
>>Alan
>>
>>>When building new forms, I found myself repeating calls to business objects dropped on the form. About half of the calls were This.Bizobj.Somefunction() and the other half Thisform.Bizobj.Somefunction().
>>>
>>>In this instance, THIS and THISFORM were the same, so I'm wondering which would be the better to use, and why. Neither Help or HackFox 7 shed any light on this thought.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform