>Hi all
>
>I am currently trying to adapt Locale.vcx by Greg. His original code (as will be found in the downloads section) does not work on pageframes (atleast for me <g>) so I added a similar code in the FOR EACH loop, on doing so the recorsion goes into infinite loop. What have I done wrong, please advise.
>
>
>method setlocale()
>
FOR EACH oObj IN tcObj.OBJECTS
>...
>...
>
>*** this is original Greg's code
> IF PEMSTATUS(oObj,"Objects",5)
> IF oObj.OBJECTS.COUNT>0
> this.setLocale( oObj )
> ENDIF
> ENDIF
> >*** this is my copy of the original
> IF PEMSTATUS(oObj,"Pages",5)
> IF oObj.Pages.COUNT>0
> this.setLocale( oObj )
> ENDIF
> ENDIF
>NEXT
As Christian said, it would have to be really recursive - tcObj would have to be passed as parameter, i.e. you're missing LParameters tcObj on the top.
Look at download #
21923 - you could just create the recursor object, pass your object and the procedure to run on it and its members, and run its recurse() method. It will handle recursion for you.