Hi Peter,

Most of my parsing, recently, has been on lines of g-code, similar to below

`(size of top is 80 by 73)`

g00 x-1.3750 y74.3750 z2.0000

g01 x-1.3750 y74.3750 z-1.6250 f66.6667

g01 x-1.3750 y74.3750 z-1.6250 f200.0000

g01 x81.3750 y74.3750 z-1.6250

g01 x81.3750 y-1.3750 z-1.6250

g01 x-1.3750 y-1.3750 z-1.6250

g01 x-1.3750 y74.3750 z-1.6250 f200.0000

g00 x-1.3750 y74.3750 z2.0000

(tabs on edges)

G00 x-3.0000 y76.0000 z2.0000

G01 x-3.0000 y76.0000 z-2.9500 f66.6667

G01 x34.0000 y76.0000 z-2.9500 f200.0000

G00 x34.0000 y76.0000 z-2.2500

G01 x46.0000 y76.0000 z-2.2500 f200.0000

G01 x46.0000 y76.0000 z-2.9500 f66.6667

I need to extract the values of x, y, z etc.

I have found, since case does not matter,( in this case...) e.g. can be XYZ I convert the line I'm checking to upper case, then find the X,then simply val the rest of the string to it's right. No need to read in each digit. the following picks out the x and y values, if any

`function xylen(ln as string) as Double ' get distance from origin to xy in line.`

dim p as integer ,t as integer

dim x as double, y as double

dim lns as string ' the rhs of line of text ln

x=0

y=0

t = Len (ln)

For k as Integer = 0 To t

lns= Right(ln,t-k)

if left (lns,1)= "(" then return 0

If UCase(Left (lns,1))= "X" Then

x= Val(Right(lns,(t-(k+1)) ))

end if

If UCase(Left (lns,1))= "Y" Then

y= Val(Right(lns,(t-(k+1)) ))

end if

next k

return sqr((x*x) +(y*y))

end function

I'm having to do this, because my original code was generated by software I wrote in C#, and i don't want to go back to that bloatware, so I'm adjusting the code it produces using fb. If I can find my original source code, if it's lengthy, then I'll parse that too, and convert much of it to fb. Hopefully the fb compiler will pick up the rest.