rendered paste bodyobjectdef deskcontents
{
variable index:odrawer testy
}
objectdef odrawer
{
variable index:ocompartment compartments
}
objectdef ocompartment
{
variable string slot1
variable string slot2
}
function main()
{
echo "--------------"
declare messydesk deskcontents
declare counter int 1
messydesk.testy:Insert[1]
messydesk.testy.Get[1].compartments:Insert[1]
messydesk.testy.Get[1].compartments.Get[1].slot1:Set[pen]
messydesk.testy.Get[1].compartments.Get[1].slot2:Set[pencil]
messydesk.testy:Insert[2]
messydesk.testy.Get[2].compartments:Insert[1]
messydesk.testy.Get[2].compartments.Get[1].slot1:Set[rubberband]
messydesk.testy.Get[2].compartments.Get[1].slot2:Set[junk]
echo " stuff in desk ${messydesk.testy.Get[1].compartments.Get[1].slot1} "
messydesk.testy:Remove[1]
messydesk.testy:Remove[2]
messydesk:Collapse
echo " clean desk..puttin more stuff"
messydesk:Insert[1]
messydesk.testy.Get[1].compartments:Insert[1]
messydesk.testy.Get[1].compartments.Get[1].slot1:Set[mags]
messydesk.testy.Get[1].compartments.Get[1].slot2:Set[9mm]
echo " new stuff in desk ${messydesk.testy.Get[1].compartments.Get[1].slot1} "
}