groups and background

Dar Scott dsc at swcp.com
Fri Dec 27 13:58:01 EST 2002


On Friday, December 27, 2002, at 09:57 AM, Rob Cozens wrote:

>>> I believe the distinction is "background" can refer to any group in a 
>>> stack, whereas "group" can refer only to groups on the current card.
>>
>> Ah.  I have been using "background" to mean a group with background 
>> behavior.  Now, now this is twice as confusing.
>
> If I am correct, "put there is a background/group [groupName/groupId]" 
> should yield different results depending on whether the group is placed 
> on the current card.
>
> I could test this for you, Dar; but it was your question...and 
> self-discovery is much more meaningful, don't you think?

I think this illustrates my point.  By using the word "place", I assume 
you mean groups with background behavior.  Are you saying that one would 
normally make all groups have background behavior.  Mine rarely do.

It gets worse.

I have a stack with two cards.  Card one has three groups a, b and c.  
Group a is nested in group b.  Group c has background behavior.  Card 
two has c placed on it.

Results from number of:

                  Card 1         Card 2
groups             3              1
backgrounds        2              2

So, "the number of groups" returns something I understand.  But, "the 
number of backgrounds" is not clear.  I would have thought it would 
return 1 in both cases, since there is only one group with background 
behavior, or return 3 in both cases since there are 3 groups (with or 
without background behavior) in the stack.

Though the number of backgrounds is 2, I can refer to background n, for 
n=1,2,3 and refer to each of the groups in the stack.

Also groupNames of card 1 does not include group a and backgroundNames 
of the stack has only the group with the background behavior.

So, we have three different counts for background.

Consider the TD for "place".  It says that when you use create card any 
groups on the current card are automatically placed on the new card.  
This is not so.  Only those groups with background behavior are placed.  
I'm not sure whether this is a typo or an assumption that, of course, 
groups have background behavior.

To me, the most intuitive meaning of "background" is a group used as a 
background, that is, a group with background behavior.  Even if I drop 
that notion, we still have an inconsistent use of "background".  It 
means one thing when referring to background behavior or backgroundNames 
and two other things in number and group reference.  This inconsistency 
is compounded by the inconsistent insertion of the the script of a group 
with background behavior after the card; a control on the card sees it, 
but a control in a group on the card (with no background behavior) or 
the group itself does not.

This inconsistency complicates some programming, but the greater cost is 
in the learning curve.  "Let's see, do I want the number of backgrounds 
or the number of lines of backgroundNames?"

Dar Scott








More information about the Use-livecode mailing list