Indirect Tag binding and the Case Statement

Hello,

I am attempting to pull values from an (offset array number index number). Below is listed the code that I have. However, you'll see from the snip that my [.]Cut Type keeps getting returned rather than the value I'm looking for. I'm sure it's just a structuring problem so I wondered if someone could help me with the structuring. It's probably something simple but I am at a loss right now.

case(
	{[.]Cut Type},
	1, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../.. IndexNumber 3}],
	2, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	3, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	0,
)


Fixed! Thanks for that! Still having the same issue inside the designer.

I don't understand this. Can you add captions to the images to explain what you are showing us?

What I'm attempting to display is the values you see from OffsetArray6(95/96/97/98). In this case, "B" from the UDT is attempting to call the value from either the Index Array 1 or 3 depending on "Cut Type" being either a 1, 2, or a 3. However, I'm having problems building the dynamic tag structure. You can see from the uploaded snip, that the "Array Number" and the "Index Number X" can have different values.

There you can see the "Cut Type" tag returning a 1. I want to evaluate the Cut Type value, and then decide via the case statement which Array# and Index# to build onto my "OffsetArray" tag.

I'm still looking at it.
I've noticed an incorrect comma in the original expression but I'd expect that to give you an expression error in Tag Browser. Fix it anyway!

case(
	{[.]Cut Type},
	1, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 3}],
	2, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	3, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	0,     // <---- Comma shouldn't be there.
)

Fixed! I want to develop good habits so I'm open to any and all suggestions.

As a debug, add a string tag, copy the binding over and edit out the tag function so that it returns the string path.

case(
	{[.]Cut Type},
	1, ("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 3}],
	2, ("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	3, ("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	0
)

Check carefully that the path is correct.

I did that and I get a return value of 2.0

case(
	{[.]Cut Type},
    //      ,--- unmatched {!
	1, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 3}],
	2, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	3, tag("{[.]../../OffsetArrays/OffsetArray" + {[.]../../ArrayNumber}) [{[.]../../IndexNumber 1}],
	0
)

Is the unmatched '{' the problem? It shouldn't be there.