Background Group Question

David Burgun dburgun at dsl.pipex.com
Thu Oct 13 09:14:26 EDT 2005


Hi

I solved the problem like this:

repeat with myCardIndex = 1 to the number of cards in stack myStackLongName
go to card myCardIndex  of  myStackLongName --******************************
repeat with myControl index = 1 to the number of controls in card 
myCardIndex of stack  myStackLongName
    put the long name of control myControlIndex into myControlLongName
    put GetControlData(myControlLongName) into myControlData
    put myControlData into myControlArray[myControlLongName]
    end repeat
end repeat

go to card 1 of myStackLongName  --******************************


Lines with ***** have been added!

Thanks for your help, the explaination of Background objects was really useful.

All the Best
Dave

>The key point may be scope issues.
>
>-1- Where is the script located?  in one of the groups, the card, the stack
>-2- You could use stack custom properties to do this and be available to all
>cards and groups
>-3- You could use a global variable and be available to all stacks and cards
>
>>  How can I add the entries for background object on cards other than
>>  the 1st card?
>I believe backgrounds are part of the stack (not a card) so you should not
>have to go to a card that holds that background, and thus use the following
>line:
>put the number of controls => all (bg1+bg2+bg3+bg4)
>
>put the number of controls in bg 1 = only those (bg1)
>put the number of controls in card 2 = only those (bg1 + bg2)
>put the number of controls in card 3 = only those (bg1 + bg3)
>**however, bg1 is the same set of controls as card 2, depending on how you
>have your objects setup [same name, id, geometry, etc]
>
>Catch may be that the same bg on different cards is simply the same
>controls, like a shared text field.  In fact, it may be easier and more
>effective to use a shared field in a fifth bg that appears on all cards.
>
>I am not sure what you are trying to set/get.  Is this data that is stored
>for each control on each card?  Since the long name of the control is the
>same even if the bg does not appear on any card, why are you looping through
>the number of cards?
>
>Hope this helps
>
>Jim Ault
>Las Vegas
>[I take no credit or culpability for errors, but must share in any profits
>derived from my answers and advice]
>
>On 10/12/05 2:16 AM, "David Burgun" <dburgun at dsl.pipex.com> wrote:
>
>>  Hi,
>>
>>  I have a stack with two cards. There are 4 Common Background Groups
>>  and one Group that is unique in each card. At startup I build a
>>  look-up table (array) which uses the long name of each control as a
>>  key. Once the stack is running the code looks up values for certain
>>  fields and menu's using the long name of the current control to
>>  access the table/array.
>>
>>  I use the following to build the table at startup:
>>
>  > repeat with myCardIndex = 1 to the number of cards in stack myStackLongName
>>     repeat with myControl index = 1 to the number of controls in card
>>  myCardIndex of stack  myStackLongName
>>     put the long name of control myControlIndex into myControlLongName
>>     put GetControlData(myControlLongName) into myControlData
>>     put myControlData into myControlArray[myControlLongName]
>>     end repeat
>>  end repeat
>  >
>>  The problem with this is that for background I only get one entry
>>  returned (the entry of the 1st card in the stack), so that the
>>  following doesn't work when run from a card other than the 1st card:
>>
>>  put LookUpControl(the long name of me) into myControlData
>>
>>  How can I add the entries for background object on cards other than
>>  the 1st card?
>>
>>  Thanks a lot
>>  All the Best
>>  Dave
>>
>>
>>  _______________________________________________
>>  use-revolution mailing list
>>  use-revolution at lists.runrev.com
>>  Please visit this url to subscribe, unsubscribe and manage your subscription
>>  preferences:
>>  http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list