I need to parse a line of text which has several groups of numerical data. I need the text from the Nth group so I can convert it to Real with the Val() function. I've started a function:
function TForm1.FindNthWord( aline :String; acol :integer ) :String;
where 'aline' is a complete line of text and 'acol' is the Nth group of text separated by spaces
returns the text in the Nth group
For example, here is a partial line of text:
90.00 0.00 -999.99 12.44 12.44 0.00000 -90.00
I want to return the 4th group, 12.44. The number of spaces and size of the text clusters is not constant. I can think of a very messy way of doing this but I need something more elegant.
Can some one point me to a string function that will help? I've only found PosEx so far.