Page 1 of 1

field function

Posted: Thu Mar 31, 2011 6:13 am
by subrat
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

Posted: Thu Mar 31, 2011 6:32 am
by chulett
Biggest problem I see is there's no Field() function in your code. :wink:

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?

Posted: Thu Mar 31, 2011 11:34 am
by subrat
chulett wrote:Biggest problem I see is there's no Field() function in your code. :wink:

To use Field to extract "X Y" from a space delimited string, you'll need to pull two fields, not one... and ...
Sorry missed the Field ;-)

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.

Posted: Thu Mar 31, 2011 3:41 pm
by ray.wurlod
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 "".