Looping in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • helraizer1
    New Member
    • Mar 2007
    • 118

    Looping in VB

    Hey alI, I have the VB code that opens and closes the CD drive

    [code="vb"]

    <script language="VBScr ipt">
    <!--

    Sub Close()
    Set oWMP = CreateObject("W MPlayer.OCX.7" )
    Set colCDROMs = oWMP.cdromColle ction

    if colCDROMs.Count >= 1 then
    For i = 0 to colCDROMs.Count - 1
    colCDROMs.Item( i).Eject
    Next ' cdrom

    For i = 0 to colCDROMs.Count - 1
    colCDROMs.Item( i).Eject
    Next


    End If
    End Sub

    -->
    </script>
    [/code]

    Is there anyway that I can add a loop to this so that it will keep doing it, over and over until another button is pressed/another function is called?
Working...