Hi,
I need to perform a certain operation on all objects that a form contains (and no, SetAll method won't suffice). For this, I created a following method:
, called with the command thisform.recurfunc("thisform"). In theory, any "branch" object that has an object list of its own (the form itself, page frames, grids, etc.) would call the same method with its full path as a parameter, while the "leaf" objects wouldn't.
Contrary to my expectations, TYPE("thisform.Objects") returned "U" instead of "O" to me (even though the form object, naturally, *has* an Objects property), making distinction between containers and non-containers impossible. If I delete the checking, recursion works okay but only until it reaches a leaf.
What am I doing wrong and how can I achieve what I need?
Thanks.
I need to perform a certain operation on all objects that a form contains (and no, SetAll method won't suffice). For this, I created a following method:
Code:
PROCEDURE recurfunc
PARAMETERS targetname as String
PRIVATE member as Object
&& ( the operation itself )
IF TYPE(targetname+".Objects")="O"
FOR EACH member IN (targetname+".Objects")
thisform.recurfunc(targetname+"."+member.name)
ENDFOR
ENDIF
Contrary to my expectations, TYPE("thisform.Objects") returned "U" instead of "O" to me (even though the form object, naturally, *has* an Objects property), making distinction between containers and non-containers impossible. If I delete the checking, recursion works okay but only until it reaches a leaf.
What am I doing wrong and how can I achieve what I need?
Thanks.