Skip to Content
0

How to get Text element from Array

Sep 27, 2017 at 12:37 PM

25

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Ian Waterman Sep 27, 2017 at 01:03 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

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

Ian

0
avatar image
Former Member Sep 27, 2017 at 12:41 PM
0

I found it:

Global StringVar Design ;
If UBound(myString)>=2
Then Design:= ToText(myString[2]);
Share
10 |10000 characters needed characters left characters exceeded
Ian Waterman Sep 27, 2017 at 12:50 PM
0

Try

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

Ian

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank You

in this way it doesn't want work

0