I have a really strange issue happening on a SAIL form. Basically I have a two l

I have a really strange issue happening on a SAIL form. Basically I have a two local variables which contain any type arrays (X and Y). I then have a 3rd local variable (Z) where I'm trying to place either array X or array Y, based on a local boolean variable which I've set using an expression.

=load(
local!arrayX:ri!input1,
local!arrayY:ri!input2,
local!isBoolean:if(local!integerA=0,true,false),
local!arrayZ:if(local!isBoolean,local!arrayX,local!arrayY)
)

The issue is that array Z is always returning only the first index of either array X or array Y. I want it to return the whole array. I'm not really sure why this is happening. And the strangest part is that if I set local!isBoolean as true or false directly (not using an expression), then array Z returns the entire array that I want.

Anyone seen anything similar? This seems really odd. I've displayed the values of all of my arrays and boolean variable on the form so I know that th...

SAIL issue with boolean expression.doc

OriginalPostID-146293

OriginalPostID-146293

  Discussion posts and replies are publicly visible

Parents
  • One more example to play with it. This tells that the final result for each evaluation of Nested-IFs series is determined by the sequence of associated boolean values within each IF. For example in 2nd evaluation, a sequence of False->True resulted in to "IF2-True", and in 3rd evaluation a sequence of False->False->False is resulted in to "IF3-False". This type of coding style dramatically reduces the dependency of looping functions like apply().

    Check results for this expression:

    if({true, false, false}, "IF1-True",
    if({false, true, false}, "IF2-True",
    if({true, false, false}, "IF3-True",
    "IF3-False"
    )
    )
    )
Reply
  • One more example to play with it. This tells that the final result for each evaluation of Nested-IFs series is determined by the sequence of associated boolean values within each IF. For example in 2nd evaluation, a sequence of False->True resulted in to "IF2-True", and in 3rd evaluation a sequence of False->False->False is resulted in to "IF3-False". This type of coding style dramatically reduces the dependency of looping functions like apply().

    Check results for this expression:

    if({true, false, false}, "IF1-True",
    if({false, true, false}, "IF2-True",
    if({true, false, false}, "IF3-True",
    "IF3-False"
    )
    )
    )
Children
No Data