Easy Question

I have a multivalue field - Example below.

Finish>><<Para 20 PR>><<101>><<PA - 100 Asphalt>><<1>><><<Para 20 TS>><<153>><><<1

Finish>><<Para 30 FR TG>><<280>><><<2>><><<Para 20 TG>><<140>><><<2

I need to search within the multivalue field for the word “Torch” (4th value) and if found, pull the top ply (2nd value) and the base ply (7th value) from that list. So, based on the example above, only the second list has “Torch” in the 4th position. so my top ply would be Para 30 FR and my base ply would be Para 20 TG.

Instead when “Torch” is found, I’m returned top - Para 20 PR and base - Para 20 TS which are not the correct values to return.

I’m sure this is very easy, but for some reason I’m perplexed…

Subject: Easy Question

_List:=;_Top:=“”;

_Base:=“”;

@For(i:=0;i<@Elements(_List);i:=i+1;

@Do(

_Values=@Explode(_List[i+1];">><<");

@If(_Values[4]="Torch";

  @Do(

    _Top:=_Top:_Values[2];

    _Base:=_Base:_Values[7]

     );

  "")

)

);

_Base:=@Trim(_Base);

_Top:=@Trim(_Top);

This should return _Top and _Base, please try it first since I just typed it without checking…

Subject: RE: Easy Question

It worked great!

Thank you.

Subject: Easy Question

Document doc = ;Vector v = doc.getFirstItem(“YourMultiValueField”).getValues();

if( ((String)v.elementAt(3)).equals(“Torch”)){

String seccondVal = v.elementAt(1);

String seventhVal = v.elementAt(6);

}

Regards,

Litty Joseph