ltannous
22nd July 2005, 22:59
I have a current BaaN field in my report (tcedi750.data) that is a multi byte string.
This string is displayed in GTM as a pipe delimeted ("|") string. How can I select a portion of that string....
example:

c2100507190005|250|001||12000025A|10|0|0|050719|11800|387742|

I am trying to pull the 5th field (12000025A).
If I cannot select it by delimeter, the data is always in the same postion, how can I get that.

Thanks for any help.

lbencic
22nd July 2005, 23:12
You should be able to use string.scan for this:

Example
double D

long L

string S(80)

long ret

ret = string.scan("string|123|456.78","%s|%d|%f",S,L,D)

| S contains "string", L contains 123, D contains 456.78

mark_h
22nd July 2005, 23:22
You can use string.scan.

scan.ret = string.scan(buff,"%s|%s|%s|%s|%s|%s",
field1,
field2,
field3,
field4,
field5,
field6)
Something like the above. Or am I mis-understanding the question.