Thanks Kay and Phil. I've gone back to using the original handler since obviously getting the controls of a stack isn't reliable. I feel like missing random controls in multi card stacks is a bug, but my opinion on what is a bug and what isn't seems to differ from others on this list so what do you think? I doubt there's any chance of it being fixed but I don;t think that's a reason to not report it.
Phil, thanks for the array tip - turns out I am using an array although not for the reason you mentioned. Sometimes you just get lucky I guess! Not sure how to deal with the backgrounds that aren't on any cards. I have rarely used backgrounds but out of interest, does the IDE Application Browser show these unplaced backgrounds? Pete lcSQL Software <http://www.lcsql.com> On Mon, Jan 21, 2013 at 9:48 PM, Phil Davis <[email protected]> wrote: > Another twist in the pursuit of truth: > Backgrounds not placed on any card are included in "the number of > backgrounds in this stack" but nowhere else. (Neither are their controls) > You have to place them onto a card to count their controls. > > You could cycle through all the cards and do this: > put the name of control x of this cd into tControlArray[ the short id > of control x of this cd ] > > When you're done, the array structure itself will have eliminated > duplicate references. tControlArray contains all control names keyed by > their unique IDs. Except for those pesky 0 ID controls. And the controls in > any unplaced BGs. > > Phil Davis > > > > On 1/21/13 9:14 PM, Kay C Lan wrote: > >> On Tue, Jan 22, 2013 at 3:29 AM, Peter Haworth <[email protected]> wrote: >> >>> Looking at the controls that are missed, they are almost all from stacks >>> that contain multiple cards, seemingly randomly missing a few from each >>> card. There are also a handful that have an id of zero which I didn't >>> think was possible but that's another topic. >>> >> Quick test: >> >> 1) New Main Stack >> 2) Add a button, >> 3) Add a new card >> 4) Add a button >> 5) Go back to cd 1 and group the single btn and turn it into a background >> 6) Add a Card (this should come with the bkgnd btn) >> 7) Add to this a normal btn. >> >> So you should have a 3 card stack with 1 card that has a bkgnd btn on >> it, a 2nd card with a bkgnd btn + a normal btn, and a 3rd card with >> just a normal btn. >> >> Total number of controls for the stack is 4 (a group for the bkgnd, a >> btn in the bkgnd group, and two normal btns. >> >> In the msg box if I enter: >> >> put the number of controls of stack "test" >> >> the answer I get back is always the number of controls of the current >> front most card of the stack, I can not get 4 as the answer. >> >> So if I happen to be on the card with only the normal btn, then the >> answer is 1, the answer you want is 4, and if I loop through the cards >> the answer I get is 6. >> >> As you've already figured, the problem is associated with multi-card >> stacks, from what I can tell 'the number of controls of this stack' >> will never give the correct answer for a multi-card stack, and if you >> loop through all the cards you'll end up duplicating the process for >> any background controls. >> >> HTH >> >> ______________________________**_________________ >> use-livecode mailing list >> [email protected] >> Please visit this url to subscribe, unsubscribe and manage your >> subscription preferences: >> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode> >> >> > -- > Phil Davis > > > > ______________________________**_________________ > use-livecode mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode> > _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
