@ Lucmar
Your functor always return 65. But maybe I didn't explain the problem very well.
I have a list box with 27,000 + lines.
Each line looks as follows, of course with different values.
// LAN , YSSY , NZAA , B789_LAN_LATAM , 0010 , LA800 , CC-BGA , 0 ,0325
Each line can consist of either 8 or 9 fields delimited by a comma. The spaces between the comma is not uniform. So the record could look like the above orl ike so:
// LAN, YSSY, NZAA , B789_LAN_LATAM , 0010,LA800, CC-BGA ,0,0325
I count the commas to get the number of fields and add 1.
If I want the first field I can do a str := Copy(Line,1,3);
But with field 2 I need to know where the first and second comma are located.
Third field the 2 and and 3rd location of commas.
And so on until I reach 9 or 10 fields.
What I.m trying to do with;
function CutLoc (Const aInt : Integer; aStr : String) : Integer;
is pass the number of the comma I want the location for.
So if I'm looking for the third comma of the following string the function should hand back
16 and the forth comma 34.
So 16 +1 = 17
Cut1 := 17;
Cut2 := 34;
Field4 := (Line,Cut1,cut2);
Field4 = ' B789_LAN_LATAM'
Trim Field4 and I should wind up with Field4 := 'B789_LAN_LATAM'
1 2 3 4 5 6
123456789012345678901234567890123456789012345678901234567890
LAN, YSSY, NZAA , B789_LAN_LATAM , 0010,LA800, CC-BGA ,0,0325