Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Click Event of 'Revert' button
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00455182
Message ID:
00455285
Views:
27
I know that code should be as clean and efficient as possible. But just out of curiosity, at what point does executing a loop increase performance over specifying the command line-by-line for each control?

I usually use a rule-of-thumb of four or more...


- Brian


>>Instead of the code bellow, BTW, you can use this: (increases Readability)
>>
>>With ThisForm.Commandgroup1
>>     store .f. to .command1.enabled, .command2.enabled
>>endwith
>>for i=3 to 9
>>    store .t. to ('ThisForm.Commandgroup1.command'+transfrom(i)+'.enabled')
>>next
>>
>
>Or:
>
>
WITH ThisForm.Commandgroup1
>   .SetAll("Enabled", .F.)
>   .Command1.Enabled = .T.
>   .Command2.Enabled = .T.
>ENDwith


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Previous
Reply
Map
View

Click here to load this message in the networking platform