cjard,
I tried that, but this part of the code won't work in my version of VB.net wich is 2002.
If Not Double.TryParse(regexMatch.Groups(1).ToString(), xNumber) Then
MessageBox.Show("Failed to convert this to a double:" & regexMatch.Captures(0).ToString())
Continue For
End If
Gary
Things are looking good now, I redid it and it replaces everything it should!
But I just noticed a problem. Please run this section of my data through yours and look at the very last X on line N248 which is X0.9375. Now take that times 25.4 it should be 23.8125 but I get 22.86375. Now 25.4 *...
Sorry nogo. This is what I get when I run it:
N1G01 F10 X1.41951794524489E+15 Y0.0625
N2 Z0.02 F10
N3 Z-0.04 F1
N4 Y1.9375 F2.5
N5 X1.1356143561959E+15 F5
N6 Y0.0625
N7 X1.70342153429387E+15
N8 Y1.9375
N9 X851710767146931 F5
N10 Y0.0625
N11 X1.98732512334284E+15
The thing of it is...
Ok, might be getting somewhere. I put a space after ever line so that is fixed. Plus I am getting the correct values. Now just how do I replace these values using absolut's sub?
Sub findAndReplace()
Dim str As String
Dim arr() As String
Dim tmp As Double
str =...
Ok, here is something I found.
N1G01 F10 X0.5 Y0.0625
N2 Z0.02 F10
N3 Z-0.04 F1
N4 Y1.9375 F2.5
N5 X0.4 F5
N6 Y0.0625
N7 X0.6
N8 Y1.9375
N9 X0.3 F5
N10 Y0.0625
N11 X0.7
Look at line number N7 it doesn't have a space after it. So it try's to include N8 along with the number X0.6. After the N8...
It don't work on my end.
I can't use findAndReplace("X0.5", "X0.15") because I don't know what the numbers would be.
When I run my program I simply want to click a button and then have a function read line by line and convert the values at the X location from inch to mm.
N1G01 F10 X0.5...
I tried that but it will only change the last line, it won't change line 1 or 5.
N1G01 F10 X0.5 Y0.0625
N2 Z0.02 F10
N3 Z-0.04 F1
N4 Y1.9375 F2.5
N5 X0.4 F5
N6 Y0.0625
N7 X0.6
Thanks
Gary
Hope someone can help on this one!
What I have is lines of text in a richtextbox which look like this:
N1G01 F10 X0.5 Y0.0625
N2 Z0.02 F10
N3 Z-0.04 F1
N4 Y1.9375 F2.5
N5 X0.4 F5
N6 Y0.0625
N7 X0.6
What I need to do is find and replace the number right after the X. My problem has been that the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.