|
-
Aug 21st, 2001, 08:52 PM
#1
Thread Starter
Lively Member
output to a text box
How do I put the results of numerous formulas into one text box? It has to be in a format using "XYZ"'s in the cartesian coordinate system. X__ Y __ Z__
-
Aug 21st, 2001, 09:06 PM
#2
Member
Uh, textboxname.Text = "whatever you want"? Or do I misunderstand the problem?
-
Aug 21st, 2001, 09:07 PM
#3
Fanatic Member
Im assuming you have the results stored in variables if so you could simply do this
VB Code:
Public Function fillText(x As Integer, y As Integer, Z As Integer)
If Len(text1.Text) = 0 then
Text1.Text = x & ", " & y & ", " & z
else
Text1.text = Text1.text & " - " & x & ", " & y & ", " & z
end if
End Function
'call the function like this
fillText 12,14,16
'The number values could also be any variables you are using
Hope that was close to what you were wanting to do
-
Aug 21st, 2001, 09:08 PM
#4
Fanatic Member
Ps by using it in a function you can simply call the function from whatever routine yuo have that is collecting the values also allows you to call it from other routines to update the data
-
Aug 21st, 2001, 09:40 PM
#5
Frenzied Member
Please specify what you want to do.
-
Aug 21st, 2001, 09:45 PM
#6
Thread Starter
Lively Member
output
I'm sorry, I should have been more specific. Out put is simple, I am having trouble with a multiple line format. If that makes any sense.
t = txtdia.Text
p = txtpitch.Text
z = txtflutes.Text
f = txtchipload.Text
v = txtSFM.Text
cl = txtclearance.Text
n = (v * 12) / (pi * t)
f1 = f * z * n
f2 = f1 * (Major - t) / Major
ri = Minor / 2
ro = Major / 2
re = ((ri - cl) ^ 2 + ro ^ 2) / (2 * ro)
D = 20 / Major / p
a = pi * Major / 4
r = a * (Tan(D * (pi / 180)))
p1 = 1 / p
X = 0
Y = (-ri) + cl
'txtprogram = N10 G90 G0 X Y Z
'G91 G41 D? X Y -0.578250 Z
' G3 X 0.625000 Y 0.579998 Z
' G3 X Y Z
' G3 X -0.625000 Y 0.579998 Z 0.014569 R 0.579998
' G0 G40 X Y -0.578250 Z
' M1
anyhow, I hope you get the Idea. The lines had to be cut short for this. I also have to be able to cut and paste into word with only single spaces between.
-
Aug 21st, 2001, 09:47 PM
#7
Member
If you want to make multiple lines in a textbox, change its multiline property to True and end lines with vbCrlLf, like this:
VB Code:
Const toDisplay As String = "Line 1" & vbCrLf & "Second Line"
-
Aug 21st, 2001, 09:50 PM
#8
Thread Starter
Lively Member
I'm sorry, but I still don't understand. I am new at this.
-
Aug 21st, 2001, 09:56 PM
#9
Thread Starter
Lively Member
-
Aug 21st, 2001, 09:57 PM
#10
Member
-
Aug 21st, 2001, 10:10 PM
#11
Thread Starter
Lively Member
this is what I have now. On the line starting with G91. I want the answer to an equation after the D with no space.
txtprogram.text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D"
-
Aug 21st, 2001, 10:21 PM
#12
Fanatic Member
to get that just put this
VB Code:
txtprogram.text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D"
txtprogram.text = txtprogram.text & youranswerhere
-
Aug 21st, 2001, 10:27 PM
#13
Thread Starter
Lively Member
txtprogram.Text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D? X0 Y? Z0" & vbCrLf & "G3 X? Y? Z? R? S? F?" & vbCrLf & "G3 X0 Y0 Z? I? J0" & vbCrLf & "G3 X? Y? Z? R?" & vbCrLf & "G0 G40 X0 Y? Z0" & vbCrLf & "M1"
txtprogram.Text = txtprogram.text& txtdvalue.Text
Like this? I have to put an answer to a formula at every question mark.
-
Aug 21st, 2001, 10:30 PM
#14
Thread Starter
Lively Member
By doing that, the M1 turns into M15
-
Aug 21st, 2001, 10:31 PM
#15
Thread Starter
Lively Member
that is if the answer for txtdvalue.text is 5
-
Aug 21st, 2001, 10:36 PM
#16
Thread Starter
Lively Member
it seems i just have to " " & txtdvalue & " "
-
Aug 21st, 2001, 10:54 PM
#17
Fanatic Member
thats correct
SOrry I thought you just had the 1 line that you used in your example
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|