Skip to Content

How to get Text element from Array

Hello,

in another thread I asked similar thing 'How to get element from Array'

and the Solution is via UBound , but Ubound returns Number only

How get into variable Text element/index from Array?

Thank You

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 27, 2017 at 01:03 PM

    I have used your text from original post and both the formula below work

    If Ubound(split('F1E|I21|R|4|30|50|180|35|BG340SR|S10|D11|T10|1P|PVC|PZS-Z25|HS|/|F11|R20|K7035|T7035|/|SNAL|/,|/,/|TOB,S|H,2|/|VZKT|VZKT|SD|','|')) >= 2 then split('F1E|I21|R|4|30|50|180|35|BG340SR|S10|D11|T10|1P|PVC|PZS-Z25|HS|/|F11|R20|K7035|T7035|/|SNAL|/,|/,/|TOB,S|H,2|/|VZKT|VZKT|SD|','|')[2]

    or without Ubound

    split('F1E|I21|R|4|30|50|180|35|BG340SR|S10|D11|T10|1P|PVC|PZS-Z25|HS|/|F11|R20|K7035|T7035|/|SNAL|/,|/,/|TOB,S|H,2|/|VZKT|VZKT|SD|','|')[2]

    Both return element 2

    I21

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 12:41 PM

    I found it:

    Global StringVar Design ;
    If UBound(myString)>=2
    Then Design:= ToText(myString[2]);
    
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 27, 2017 at 12:50 PM

    Try

    split({originalTextfield},'|')[2]

    Ian

    Add comment
    10|10000 characters needed characters exceeded