Halting one function after calling another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shuggie
    New Member
    • Mar 2010
    • 1

    Halting one function after calling another

    After I call a public function I want to halt or pause the first function, can this be done?
  • Kinwang2009
    New Member
    • Feb 2010
    • 22

    #2
    Hi shuggie,
    My answer is Yes as per your qoestion 'can this be done?'.
    Thankx

    Comment

    • vb5prgrmr
      Recognized Expert Contributor
      • Oct 2009
      • 305

      #3
      Code:
      Private Sub MyFirstSub()
      If MyFirstFunction = True Then Exit Sub
      MsgBox "must have been false"
      End Sub
      
      Private Function MyFirstFunction() As Boolean
      MyFirstFunction = True
      End Function
      or change MyFirstFunction = False...

      So Is that what you mean?



      Good Luck

      Comment

      • Md Ashraful Isl
        New Member
        • Dec 2016
        • 3

        #4
        See My Code Example:
        Public Paused As Boolean

        Public Function YourF()
        'Supposse you have wrote codes here
        Paused = True
        Do While Paused
        DoEvents ' If paused = true funtion is paused
        Loop
        'Code after pause
        End Function

        Public Function BreakPause()
        Paused = False()
        End Sub

        'Please answer my question if you found

        Comment

        Working...