This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jun 14, 2015, 2:21 PM
8 Posts

Old Formula

  • Category: Application Development
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: Formula Language,archaic
  • Replies: 3

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

Jun 23, 2015, 8:56 PM
43 Posts
Classic!
A very complex formula that a new @function was added to achieve 10 years ago but the app was never updated. Sounds like there is a lot of opportunity for application improvement in this space. I'm sure you will find some more goodies.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal