Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form with Check Boxes
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00582763
Message ID:
00582909
Views:
43
>>What does this word mean then? :) What's the correct word instead? ...
>
>Nadya,
>
>Steve was referring that hardcoding anything is usually a bad idea as it requires code changes to adapt to later business changes. Hardcoding is something to be avoided unless ther is a very strong reason to do it.
>
>For example, with your idea if I decide later to add 6 more checkboxes and to remove 3 of the ones that were there I have to remember to change the hardcoded array stuff also or else the form will fail. With Marcia's idea I can add and remove checkboxes as I like and never have to visit the code that reads their values because it is not hardcoded.

Well, I agree and very rarely hard code something in code. On the other hand, we can store these checkboxes in array using amembers once and don't need to travel through each form's control and use recursion for composite controls...

There is another idea, which I was a little bit lazy to explain in my first message. The checkbox class can have property IsSelected and CheckStatus with Assign method defined. Using thisform.SetAll("CheckStatus",.t.) we can populate the array of checked checkboxes on the fly...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform