I have noticed one diffrence between version 10.1.5 that I have used and now when i have recived version 12.2 and now try run an old model I see that the ContentList for Storage has canged. In the older version the content list showed cells for the Storage capacity but now it only shows cell that is occupied by MU. See attachment. Why this change? In the model the contentlist was used like this: for i:=1 to storage.Capaity loop but now in version 12 the error Index is out of range appers. I have solved this by using following
for 1:=1 to storage.NumMu loop. Do you see any problem by using .NumMu insted of trying to looop through contentlist using Capacity?
Solved! Go to Solution.
Before version 12.0.2 the dimension of the contents list was the maximum used dimension of the storage space. Note that this can be smaller than the actual dimension of the object.
Example: Insert a ParallelProc and a Method and write the following source code:
is mu1 : object; do ParallelProc.xDim := 10; ParallelProc.yDim := 10; mu1 := .MUs.Entity.create(ParallelProc[3,6]); .MUs.Entity.create(ParallelProc[2,2]); mu1.delete; end;
When you now display the contents list, you will see a table with xDim=3 and yDim=6, although there is only an MU at (2,2).
Starting with version 12.0.2 the dimension of the contents list fits the currently used storage. Iterating through this table is faster, because it contains less VOID cells.
A good way would be to retrieve the contents as an object array, and to interate through the array with two nested for-loops:
local a := ParallelProc.ContentsList; for local y := 1 to a.yDim loop for local x := 1 to a.xDim loop local obj: object := a[x,y]; if obj /= void then print obj; end; next; next;
Please note that version 12.0.2 has a bug that returns an incorrect array. So, if you are using 12.0.2, please use a table instead until 12.0.3 is out (which will be soon):
local t : table;
t.create; -- NOTE: this line is only necessary in version 11 and older ParallelProc.ContentsList(t); for local y := 1 to t.yDim loop for local x := 1 to t.xDim loop local obj: object := t[x,y]; if obj /= void then print obj; end; next; next;