+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Senior Member Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all
    Join Date
    Jun 2004
    Posts
    379

    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.

  2. #2
    In And Above Man Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster Black Cluster's Avatar
    Join Date
    Feb 2005
    Posts
    912
    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

  3. #3
    Senior Member Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all
    Join Date
    Jun 2004
    Posts
    379
    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 .

  4. #4
    Banned SuperDooper is on a distinguished road
    Join Date
    Apr 2005
    Posts
    31
    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.

  5. #5
    Senior Member Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all
    Join Date
    Jun 2004
    Posts
    379
    Thanks for your reply but isn't wscript.shell VBscript and not VB6.0.

  6. #6
    Banned SuperDooper is on a distinguished road
    Join Date
    Apr 2005
    Posts
    31
    Yes, it is. But you can istantiate, and call vbscript/wscript object functions from within VB6.

    dim wsh: set wsh=createobject("wscript.shell")

  7. #7
    Banned SuperDooper is on a distinguished road
    Join Date
    Apr 2005
    Posts
    31
    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)

  8. #8
    Senior Member Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all Riot is a name known to all
    Join Date
    Jun 2004
    Posts
    379
    O ok thanks for your explanation.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides