How To: Automatically increment through a neighborhood in a DOCELL block
This document demonstrates how to programatically increment an AML variable in a DOCELL block.
Scalar variables cannot be used in neighborhood notation, so you must use AML variables to increment through a neighborhood.
&sv range = 16
&do i = -%range% &to %range%
&do j = -%range% &to %range%
if (%grid1%(%i%,%j%)== 10)
for_sum = scalar(for_sum + 1)
else if (%grid1%(%i%,%j%) == 20)
res_sum = scalar(res_sum + 1)
else if (%grid1%(%i%,%j%) == 25)
agr_sum = scalar(agr_sum + 1)
else if (%grid1%(%i%,%j%) == 40)
ind_sum = scalar(ind_sum + 1)
&end /* &do j
&end /* &do i
END /* DOCELL
AML code within DOCELL is evaluated and expanded before the DOCELL block is executed in GRID.