Exit For in While


Author: Dave
Date: 01.18.16 - 2:37am



Interesting little tidbit, I never knew this worked..

Dim d As Boolean

Private Sub Command1_Click()
    d = True
End Sub

Private Sub Form_Load()
    
    Me.Visible = True
    Me.Refresh
    DoEvents
    
    d = False
    
    For i = 0 To 100
        While 1
            DoEvents
            Me.Refresh
            If d Then Exit For
        Wend
    Next
    
    MsgBox "done!"
    
End Sub





Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 99 + 61 = ? followed by the letter: R 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 1 )
2023 ( 9 )
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 (22)
     VB6 CDECL
     UDT Tricks pt2
     Remote Data Extraction
     Collection Extender
     VB6 FindResource
     CDO.Message
     DirList Single Click
     Reset CheckPoint VPN Policy
     VB6 BSTR Oddities Explained
     SafeArrays in C
     BSTR and Variant in C++
     Property let optional args
     Misc Libs
     Enum Named Pipes
     Vb6 Collection in C++
     VB6 Overloaded Methods
     EXPORT FUNCDNAME Warning
     VB6 Syncronous Socket
     Simple IPC
     VB6 Auto Resize Form Elements
     Mach3 Automation
     Exit For in While
2015 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )