Display of groups in Control Browser

Wilhelm Sanke sanke at hrz.uni-kassel.de
Fri Dec 17 18:43:53 EST 2004


I looked into the problem once more and find that the guess of WA 
(Wouter) was right - a remaining difficulty is only how to implement his 
insight in the "refresh" script  - and Monte's "*value*-added" 
suggestion provided the necessary clue for the investigation.

You can test this along the lines of the example of Monte Goulding, 
which I first repeat here again:

> "Monte Goulding" <monte at sweattechnologies.com> had written:
>
> I ran into this one when working on one of my new creations. It seems that
> something other than an integer is placed into the variable using "the
> number of layers". Try this one:
>
> create a new stack with button:
>
> on mouseUp
>   -- test 1
>   put the number of layers of this cd into test
>   put "Test 1"&cr&test&cr
>   subtract 1 from item -1 of test
>   put test&cr after msg
>   -- test 2
>   put the value of the number of layers of this cd into test
>   put "Test 2"&cr&test&cr after msg
>   subtract 1 from item -1 of test
>   put test after msg
> end mouseUp
>
> you should see:
> Test 1
> 1
> 1
> Test 2
> 1
> 0



My findings are:

The problem has nothing to do with "layers", but with a  new quality of 
the difference between "the numbers of" and "the value of the numbers 
of" and irrespective of what is being counted may be layers, lines of a 
field etc.

1. Monte's "Test 1"

When you use "put the numbers of layers/lines/items/etc. into test", 
this will allow computations with the variable "test" - using "subtract 
from" or "add to" - only with the  *variable as a whole*: If you want to 
refer to sub-portions of variable "test" (line, item), you cannot use  
"subtract from" or "add to", you must apply something like "put (item -1 
of test) - 1 into test".

- "add 2 to test" works, but

- "subtract 1 from item 1 of test" (or line) does *not* work.

However - following the suggestion of WA (Wouter):

- "put (item -1 of test) - 1 into test" works.

2. Monte's "Test 2"

With "the value of the number of" you can perform any computations on 
the whole variable "test" or on its parts, using both the "subtract from 
or add to" format or with "put (item -1 of test) - 1 into test".--

You can verify this for yourself by changing Monte's test script 
accordingly.

Regards,

Wilhelm Sanke
<www.sanke.org>




More information about the metacard mailing list