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