April 27th, 2005, 07:33 PM
simple VB6.0 question
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.
April 27th, 2005, 07:59 PM
Sorry Riot, but I couldn't understand what you are leading toward. Please clarify more, by giving more relevant example!
\"The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts\".....Spaf
Everytime I learn a new thing, I discover how ignorant I am.- ... Black Cluster
April 27th, 2005, 08:06 PM
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 .
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)
April 27th, 2005, 11:05 PM
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.
April 28th, 2005, 01:40 AM
Thanks for your reply but isn't wscript.shell VBscript and not VB6.0.
April 28th, 2005, 09:26 PM
Yes, it is. But you can istantiate, and call vbscript/wscript object functions from within VB6.
dim wsh: set wsh=createobject("wscript.shell")
April 28th, 2005, 09:28 PM
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)
April 29th, 2005, 02:38 AM
O ok thanks for your explanation.