-
April 27th, 2005, 07:33 PM
#1
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
#2
Sorry Riot, but I couldn't understand what you are leading toward. Please clarify more, by giving more relevant example!
Cheers
\"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
#3
ok I am trying to make a program that makes pascals triangel and i have this code to do it
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
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 .
-
April 27th, 2005, 11:05 PM
#4
Banned
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
#5
Thanks for your reply but isn't wscript.shell VBscript and not VB6.0.
-
April 28th, 2005, 09:26 PM
#6
Banned
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
#7
Banned
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
#8
O ok thanks for your explanation.
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
|
|