-
1
- #1
Mike Lewis
Programmer
The other day, I was chatting to a fellow VFP developer, who was confused about the SetAll() method, and wondered if he had discovered a bug.
He was trying to use SetAll() to change the font of a number of objects, and was surprised that the font change was applied to objects based directly on VFP native classes "despite what it says in the Help".
He was referring to a line in the Help that says that the third parameter to SetAll() "specifies the class name (the class on which the object is based, not the Visual FoxPro base class for the object)." He interpreted that to mean that you couldn't use SetAll() with objects based on VFP base (i.e. native) classes.
Now that's not what the Help says, but I agreed that it was badly worded. I think most developers would understand what it means, but in case anyone else is confused about this, let me clarify:
2. If you specify a base class as the third parameter, it will operate on all objects directly based on that class, but not those based on subclasses of the class.
4. Also, if you specify a subclass, it won't operate on objects based on parent classes or child classes of the specified subclass. (This is a logical conclusion of points 2 and 3.)
So, clearly, there's no question of this being a bug, but the wording of the Help could be clearer.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
He was trying to use SetAll() to change the font of a number of objects, and was surprised that the font change was applied to objects based directly on VFP native classes "despite what it says in the Help".
He was referring to a line in the Help that says that the third parameter to SetAll() "specifies the class name (the class on which the object is based, not the Visual FoxPro base class for the object)." He interpreted that to mean that you couldn't use SetAll() with objects based on VFP base (i.e. native) classes.
Now that's not what the Help says, but I agreed that it was badly worded. I think most developers would understand what it means, but in case anyone else is confused about this, let me clarify:
1. If you don't specify a third parameter to SetAll(), it will operate on all objects, regardless of class.
2. If you specify a base class as the third parameter, it will operate on all objects directly based on that class, but not those based on subclasses of the class.
3. Similarly, if you specify a subclass, it will operate on all objects based on that subclass, not on those based directly on the base class. (I suppose this is obvious.)
4. Also, if you specify a subclass, it won't operate on objects based on parent classes or child classes of the specified subclass. (This is a logical conclusion of points 2 and 3.)
So, clearly, there's no question of this being a bug, but the wording of the Help could be clearer.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads