Results 1 to 3 of 3

Thread: Is the only way to make multiple instructions...

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Post

    What is the way to make multiple instructions happen in order, from a Command1_Click()?

    I was earlier suggested that I use a timer, yet Im not so sure that, that is proper. What would YOU do to have three instructions take place in ORDER, after a command1_click()?
    (It's got to be in order not all at once.)

    Many thank you's to ya,
    Daniel Christie

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    UUHmmmmmmm.............

    Code:
    Private Sub Do_Something1()
        ' do something
    End Sub
    Private Sub Do_Something2()
        ' do something
    End Sub
    Private Sub Do_Something3()
        ' do something
    End Sub
    
    Private Sub cmdGoDoSomething_Click()
        Call Do_Something1
        Call Do_Something2
        Call Do_Something3
    End Sub
    Maybe I don't understand what you ask... but this code runs 3 functions when you click the cmd button...

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    I also saw your previous post and I don't know why you say that you have things happen "all at once". Normal Vb is single-threaded. What that means is that it's not possible for more than one thing to happen at the same time. If you have for example the following three lines of code in your Command1_Click event...
    Code:
    Private Sub Command1_Click()
    
        Dim intMyVal As Integer
        
        intMyVal = 3
        intMyVal = intMyVal * intMyVal
        MsgBox intMyVal
        
    End Sub
    ..."9" will be displayed, and that can only happen if the lines are executed in order. If you want more help, please post the code that you are having a problem with, and describe why you think the lines are not being executed in order.


    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

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