Can anyone give me the correct Field function syntax please?
e.g
my req is to extrac "ASIA EUROPE" from a string. I am using below code
Lnk[Index(SurrFileslnk.COL1, "ASIA EUROPE", 1),256], " ", 1, 1)
but seems someting wrong with above
Please suggest
field function
Moderators: chulett, rschirm, roy
Biggest problem I see is there's no Field() function in your code.
To use Field to extract "X Y" from a space delimited string, you'll need to pull two fields, not one... and you would need to know what field number to start with, not the position of the sub-string in the string. Perhaps you should just substring it out?
![Wink :wink:](./images/smilies/icon_wink.gif)
To use Field to extract "X Y" from a space delimited string, you'll need to pull two fields, not one... and you would need to know what field number to start with, not the position of the sub-string in the string. Perhaps you should just substring it out?
Last edited by chulett on Thu Mar 31, 2011 2:54 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Sorry missed the Fieldchulett wrote:Biggest problem I see is there's no Field() function in your code.![]()
To use Field to extract "X Y" from a space delimited string, you'll need to pull two fields, not one... and ...
![Wink ;-)](./images/smilies/icon_wink.gif)
Field(Lnk[Index(SurrFileslnk.COL1, "ASIA EUROPE", 1),256], " ", 1, 1)
Mate, i just noticed my membership expired.. can you please put your comment once again so i can see.. Hope i will get membership renewal soon.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You don't need Field() at all. Once Index() has reported the location of the start of "ASIA EUROPE" extract an 11-character substring beginning at that position, provided that that position is not zero. Otherwise return "".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.