Hi, I dont know why i cant rember this but how do you print the output of a command to the screen like to the form. I keep thinking its me.printform but if some one could get back to me on what it really is i would be very thankful.
Printable View
Hi, I dont know why i cant rember this but how do you print the output of a command to the screen like to the form. I keep thinking its me.printform but if some one could get back to me on what it really is i would be very thankful.
Sorry Riot, but I couldn't understand what you are leading toward. Please clarify more, by giving more relevant example!
Cheers
ok I am trying to make a program that makes pascals triangel and i have this code to do it
So when the button is pushed on my prog it will print out how ever many lines wear said to but i am not sure how to have it print them out to the form as you can see i am using me.printform right now but that really would not work as you should know .Code:Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim r As Integer
r = Val(Text1.Text)
If r < t Then r = 2
If r > 11 Then r = 10
Dim a() As Integer
ReDim Preserve a(r, r + 1)
a(1, 0) = 0
a(1, 1) = 1
For i = 2 To r
a(i, 0) = 0
For j = 1 To i
a(i, j) = a(i - 1, j - 1) + a(i - 1, j)
me.printform
Next
Next
End Sub
You need to print the output to a control. A label control, textbox, etc. Or you could create an instance of the wscript.shell object and print it to the screen, not the form.
Thanks for your reply but isn't wscript.shell VBscript and not VB6.0.
Yes, it is. But you can istantiate, and call vbscript/wscript object functions from within VB6.
dim wsh: set wsh=createobject("wscript.shell")
Or you could just reference the windows script host object library in your project.
Then: dim wsh as new wscript.shell (may not be verbatim)
O ok thanks for your explanation.