>>*************************************************************** >>* method : BaseApp : Util : ContainerProp >>* description : pass a container control, an array and the name of >>* : property and this will fill the array with the >>* : property values >>* >>* parameters : toContainer,aArray,cPropToFind >>* toContainer : container object to search >>* aArray : array to fill >>* cPropToFind : property to provide values >>* returns : aArray with two columns >>* : first = cPropToFind value >>* : second = control reference >>* typ. call : >>* revisions : >>* written by : Don Simpson 04/10/02 >>**************************************************************** >>lparameters toContainer,aArray,cPropToFind >>local nParas,cString,nRows,cConStr,oControl >>#INCLUDE STRINGS.H >>nParas = pcount() >>do case >>case nParas = 3 and vartype(toContainer) = "O" and this.IsContainer(toContainer) >> * this is OK >>otherwise >> * this is NOT OK >> assert .f. message ; >> BADPARAMETERS_LOC + 'ContainerProp' + ; >> WILLRETURN_LOC >> return .F. >>endcase >>do case >>case toContainer.BaseClass = "Pageframe" >> cConStr = "toContainer.Pages" >>case toContainer.BaseClass = "Optiongroup" >> cConStr = "toContainer.Buttons" >>case toContainer.BaseClass = "Grid" >> cConStr = "toContainer.Columns" >>otherwise >> cConStr = "toContainer.Controls" >>endcase >>cString = "oControl." + cPropToFind >>for each oControl in &cConStr >> if pemstatus(oControl,cPropToFind,5) && 5 = exist >&& May be the problem is in PemStatus? alternative way (longer) would be to try >type(cString)<>"U" >> nRows = alen(aArray,1) >> if not (nRows = 1 and empty(aArray[1])) >> nRows = nRows + 1 >> endif && nRows = 1 and empty(aArray[1]) >> dimension aArray(nRows,2) >> aArray[nRows,1] = evaluate(cString) >> aArray[nRows,2] = oControl >> endif && pemstatus(oControl,cPropToFind,5) && 5 = exist >> *** recursive >>* = iif(this.IsContainer(oControl),; >>* this.ContainerProp(oControl,@aArray,cPropToFind),"") > if this.IsContainer(oControl) && I would not use IIF here > this.ContainerProp(oControl,@aArray,cPropToFind) > endif >>next oControl && at this point I get a "Nesting error" >>** next && alternate try >>** endfor && alternate try >>>>I have tried three different endings for the for each loop.