unique id numbers

MisterX b.xavier at internet.lu
Wed Jun 30 10:11:44 EDT 2004


Abraham,

Here is a script that tells you the names and ids of all controls in the
rev prop palette. So it is not impossible access them as you concluded...

Possibly accessing controls via the ID 0 owner may be the problem that
creates confusion. And going to the card seems to deliver the hidden
ID.

Note that to further create confusion and issues, this script will report
that there are duplicate objects with id 0 with duplicate names in the same
cards in the same groups!

If only RR would shed some light on this now...

on mouseup
  put fld "stackName" into thisstack
  if there is not a stack thisstack then
    answer "choose an existing stack please!"
    select text of fld "Stackname"
  end if
  put the short name of this stack into olddefstack
  set the defaultstack to thisstack

 lock messages
  lock screen

  put the number of cards in stack thisstack into cdcnt
   put 0 into badids
   repeat with c = 1 to cdcnt
    set the cursor to busy
    put the short name of cd c into thiscard
    put the number of controls in cd c into cntlcnt

    repeat with t = 1 to cntlcnt
      put the short id of control t of cd c into cID
      put the short name of control t of cd c into cname
      put the short owner of control t of cd c into cowner
      put thiscard & tab & cowner & tab & cname & tab & cID & cr after
nulist
    if cid is 0 then add 1 to badids
    end repeat

  end repeat

  set the defaultstack to olddefstack
  put nulist into fld "list"
    get FindTabStops("list")
set the tabstops of fld "List" to it
set the tabstops of fld "Listtitle" to it


  put badids
end mouseup


> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Wouter
> Sent: Wednesday, June 30, 2004 15:01
> To: use-revolution at lists.runrev.com
> Subject: Re: unique id numbers
>
>
> A follow up for those who are interested.
>
> Some controls can have 2 unique id if "0" is also considered an unique
> id.
>
> Returning an <id 0> on a <put long id of control x of card y of stack
> z>  was only encountered in stack "revPropertyPalette 1" but....
> try this in whatever stack:
>
>       put the long id of control id 0 <of whatever stack is open>
>            or
>       put the long id of btn id 0 <of whatever stack is open> (if the
> card contains a button of course)
>            etc..
>
>
> For a test on stack "revPropertyPalette 1":
>
>        put the long id of button "ItemText" of group "MenuSaveOptions"
> of group "Save options" of card "revdatabaselinkedmenu" of stack
> "revPropertyPalette 1"
>
> if the result is:
>         button id 0 of group id 0 of group id 46116 of card id 46117 of
> stack "revPropertyPalette 1"
> then
>         go card id 46117 of stack "revPropertyPalette 1"
> and try again:
>         put the long id of button "ItemText" of group "MenuSaveOptions"
> of group "Save options" of card "revdatabaselinkedmenu" of stack
> "revPropertyPalette 1"
>
> the result is:
>          button id 46258 of group id 46257 of group id 46116 of card id
> 46117 of stack "revPropertyPalette 1"
>
> then try :
>         put the long name of button id 0 of group id 46257 of group id
> 46116 of card id 46117 of stack "revPropertyPalette 1"
>            and
>         put the long name of button id 0 of group id 0 of group id 46116
> of card id 46117 of stack "revPropertyPalette 1"
>
> only
>        put the long name of button id 46257 of group id 0 of group id
> 46116 of card id 46117 of stack "revPropertyPalette 1"
> will give an error
>
>
> Whenever an <id 0> is encountered a workaround is needed.
>
> Greetings,
> WA
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list