Page 2 of 2

Posted: Sun Mar 07, 2010 12:23 pm
by Dsnew
Ray,

Thanks for the constant support. We get 1 again. Probably because both Stairand airhave a trailing "+" in them :(

Code: Select all

TEST #1
*******
 
Arg1 = Stair+1;air+2;
Arg2 = air
 
Test completed.
 

Result = 1 

Posted: Sun Mar 07, 2010 4:11 pm
by ray.wurlod
That is the limitation of which I spoke. To avoid it you need to prefix each substring with some other character, such as tilde in the following example.

Code: Select all

FUNCTION ReturnSecondOfPair(aString, aSearchString) 

* Convert string into dynamic array and prefix each substring with tilde. 
String = Convert(";", @FM, aString) 
String = Cats(Reuse("~"), String)
SearchString = "~" : aSearchString : "+" 

* Find search string within string 
FindStr SearchString In String Setting FMC,VMC,SMC 
Then 
   Ans = Field(String<FMC>, "+", 2, 1) 
End 
Else 
   Ans = "" 
End 

RETURN(Ans) 

Posted: Sun Mar 07, 2010 7:40 pm
by Dsnew
Ray - You are the MAN! Thanks much :D