>> // Now I populate the collection
>>
>> for each($atItems;$tItem;$i)
>> $myCollection{$tItem} += $alBackorders{$i})
>> end for each
>
> You want a straight assignment := not +=.
>
Thanks.
What works is:
for each($atItems;$tItem;$i)
$myCollection{$tItem} := Num($myCollection{$tItem}) +
$alBackorders{$i})
end for each
It seems, that by default (aka. prior to set it explicitly to a numeric
value), the collection value is created as a string.
I'm still wondering, how to declare a collection item with a compiler
declaration. From the manual page 77:
"Active4D extends the 4D compiler declaration syntax by allowing you to use
any valid scalar (non-array) expression, including dereferenced pointers and
collection items. The collection item need not exist, in which case it will
be created."
Unfortunately the examples given do not include collection items. I'd
appreciate, if you could tell me the exact syntax.
Furthermore I found, that by storing the collection handle in a session and
then populating the collection, a4d.debug.dump session tells me, that the
whole collection is stored within the session. I would have expected, that
only the collection handle is stored in the session.
And I can only access an item later on through
session{"myCollection"}{$tItem}
but not directly through
$myCollection{$tItem}
although I've created a global collection.
Maybe I'm missing something?
Pete
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/