Results 1 to 17 of 17

Thread: output to a text box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86

    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__

  2. #2
    Uh, textboxname.Text = "whatever you want"? Or do I misunderstand the problem?

  3. #3
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    Im assuming you have the results stored in variables if so you could simply do this

    VB Code:
    1. Public Function fillText(x As Integer, y As Integer, Z As Integer)
    2.  
    3. If Len(text1.Text) = 0 then
    4.      Text1.Text = x & ", " & y & ", " & z
    5. else
    6.      Text1.text = Text1.text &  " - " & x & ", " & y & ", " & z
    7. end if
    8.  
    9. End Function
    10.  
    11. 'call the function like this
    12.  
    13. fillText 12,14,16
    14.  
    15. 'The number values could also be any variables you are using

    Hope that was close to what you were wanting to do

  4. #4
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    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


  5. #5
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Brooklyn NY USA
    Posts
    1,258
    Please specify what you want to do.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86

    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.

  7. #7
    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:
    1. Const toDisplay As String = "Line 1" & vbCrLf & "Second Line"

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    I'm sorry, but I still don't understand. I am new at this.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    Now I get it. Thank you!

  10. #10

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    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"

  12. #12
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    to get that just put this

    VB Code:
    1. txtprogram.text = "N10 G90 G0 X0 Y0 Z0" & vbCrLf & "G91 G41 D"
    2. txtprogram.text = txtprogram.text & youranswerhere

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    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.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    By doing that, the M1 turns into M15

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    that is if the answer for txtdvalue.text is 5

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Minnesota
    Posts
    86
    it seems i just have to " " & txtdvalue & " "

  17. #17
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    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
  •  



Click Here to Expand Forum to Full Width