cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Text element from Array

former_member267979
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

former_member267979
Participant
0 Kudos

yes in the static text it works, but when I try:

Global StringVar Design := Split({Command.Parameter},'|')[2] ;
Design

where the Command.Parameter contains the string, so it doesn't work

Former Member
0 Kudos

Are you sure {Command.Parameter} always contains data in the format as per your string example.

Ian

Answers (2)

Answers (2)

Former Member
0 Kudos

Try

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

Ian

former_member267979
Participant
0 Kudos

Thank You

in this way it doesn't want work

former_member267979
Participant
0 Kudos

I found it:

Global StringVar Design ;
If UBound(myString)>=2
Then Design:= ToText(myString[2]);