Does anyone know if is possible to populate an array from a field. Then to report back on various values at different positions within the array in the footer.
Thanks Guys, i have gotten the thing working but have hit the max of 30000 loops. As i have to sort the array, (i have an array with maybe 1000 records in.) and therefore use two do loops, this has proved an insurmoutable obstacle.
Does anyone know if version 9 still has this restriction?
I worked on an interesting routine for sorting that was quite simple using the Maximum function that may get around your problem of 30,000 loops
Essentially you would figure out the maximum value of an array and assign it to a new array. Then set the value of the original element to null and do the test again....repeat until all array elements have been transfered to the new array.
Something like this (both arrays would be initialized to the same size elsewhere.
@SortArray
WhilePrintingRecords;
//both arrays would be initialized to the same size
//elsewhere.
Stringvar array Original;
Stringvar array Final; //initialized to null
numberVar temp;
numberVar m;
numberVar k;
for m := 1 to ubound(Original) do
(
temp := Maximum(Original);
if temp = "" then
exit for
else
(
Final[m] := temp;
for k := 1 to ubound(Original) do
(
if Original[k] = temp then
(
Original[k] = "";
exit for;
);
);
);
);
I don't know if this violates the 30,000 loop rule or not but I thought it was a neat little routine. If your array is numbers then convert them to strings for this routine.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.