Controls of Stack

Jan Schenkel janschenkel at yahoo.com
Fri Nov 22 01:13:01 EST 2002


--- Monte Goulding <monte at sweattechnologies.com>
wrote:
> 
> Hi All
> 
> Does everyone know that repeat with x=1 to the
> number of controls of stack y
> only enumerates the controls on the current card?
> Bit of a bugger..eh?
> 
> How does one parse all the controls of a stack
> ensuring that those in a
> background only get parsed once unless they are
> fields with the sharedText
> set to false... etc
> 
> FYI... I'm trying to develop the basis for a
> language engine when it wasn't
> a requirement for the first version of the program.
> In the short term I want
> to generate a list of objects with visible text.
> Then I'll search scripts
> for ask and answer dialogs and any other hard coded
> text.
> 
> When I have all that I'll create stack file with a
> custom property set that
> can be parsed to set everything for a particular
> language. Then I'll learn
> to translate to ... ;-)
> 
> Cheers
> 
> Monte
> 

Hi Monte,

You'll have to check the object's long ID and keep
track of group objects. Untested, but something along
these lines should work:

set the wholeMatches to true
repeat with i = 1 to the number of controls
  put the long ID of control i into tLongID
  if (word 1 of tLongID is "group") or \
     (word 5 of tLongID is "group") then
    if lineOffset(tLongID, tKnownGroupItems) > 0 then
      next repeat
    else
      put tLongID & return after tKnownGroupItems
    end if
  end if
  -- do your stuff here
end repeat    

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Use-livecode mailing list