home *** CD-ROM | disk | FTP | other *** search
/ Computer Discount - Smash Disk / SmashDisk.bin / Cdc / SRC / routines.bas < prev    next >
Encoding:
BASIC Source File  |  1998-06-09  |  813 b   |  41 lines

  1. Attribute VB_Name = "Module1"
  2. Public CDDRIVE As String
  3.  
  4.  
  5. Function GetCDDrive() As String
  6. On Error GoTo errore
  7. Dim a As Integer
  8.  
  9. a = Asc("c")
  10. While a < Asc("z")
  11.    Open Chr(a) & ":\CDC\SYSTEMS\ivano.txt" For Input As 1
  12.    Close 1
  13.    GetCDDrive = Chr(a)
  14.    Exit Function
  15. Wend
  16.  
  17. errore:
  18. a = a + 1
  19. If Chr(a) > "z" Then
  20.    If ErrorHandle("Errore nella ricerca del drive CD ROM") Then
  21.        a = Asc("c")
  22.        Resume
  23.    Else
  24.        End
  25.    End If
  26. Else: Resume
  27. End If
  28. End Function
  29.  
  30. Public Function ErrorHandle(errormsg As String) As Boolean
  31.    Dim hr As VbMsgBoxResult
  32.    
  33.    hr = MsgBox(errormsg & Chr(13) & "Continuare ?", vbYesNo, "Catalogo Computer Discount: Errore")
  34.    If hr = vbYes Then
  35.        ErrorHandle = True
  36.    Else
  37.        ErrorHandle = False
  38.    End If
  39. End Function
  40.  
  41.