Hi:
I've inherited an application. Can someone help me understand what the following formula is meant to do -(I have to update it and want to know if there's a better way to do it):
values :=vahm:vaob1:vaob2:vatender:vaeq:vaot:vaproi:vawl:vamp:vape;
list := 0;
adjust := 0;
elem := @Elements(values);
@If(elem = 1; @Return(values); elem > 8192; @Prompt([Ok]; "Error"; "Number of elements to compare exceeded 8192") + @Return(""); "");
f := @Power(2; @Integer((@Log(elem) / @Log(2))));
@Set("adjust"; elem - f);
@If(adjust = 0; @Set("list"; values); @Do(@Set("list"; ((@Max(@Subset(values; adjust); @Subset(values; -adjust))) : @Subset(@Subset(values; f); adjust - f)))));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list));
@If(f > 1; @Do(@Set("f"; f / 2); @Set("list"; ((@Max(@Subset(list; f); @Subset(list; -f)))))); @Return(list))
Thanks
Is