home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / ERRORS / ERRORS.BAS next >
Encoding:
BASIC Source File  |  1997-02-23  |  2.6 KB  |  70 lines

  1. Attribute VB_Name = "Errors"
  2. Option Explicit
  3. Const mnErrDeviceUnavailable = 68
  4. Const mnErrDiskNotReady = 71
  5. Const mnErrDeviceIO = 57
  6. Const mnErrDiskFull = 61
  7. Const mnErrBadFileName = 64
  8. Const mnErrBadFileNameOrNumber = 52
  9. Const mnErrPathDoesNotExist = 76
  10. Const mnErrBadFileMode = 54
  11. Const mnErrFileAlreadyOpen = 55
  12. Const mnErrInputPastEndOfFile = 62
  13.  
  14. Function FileErrors() As Integer
  15.     Dim intMsgType As Integer
  16.     Dim strMsg As String
  17.     Dim intResponse As Integer
  18.     ' ╖╡╗╪╓╡            ╥Γ╥σ
  19.     ' 0                 ╗╓╕┤
  20.     ' 1                 ╗╓╕┤╧┬╥╗╠⌡╙∩╛Σ
  21.     ' 2                 ╬▐╖¿╗╓╕┤╡─┤φ╬≤
  22.     ' 3                 ╬▐╖¿╩╢▒≡╡─┤φ╬≤
  23.     intMsgType = vbExclamation
  24.     Select Case Err.Number
  25.         Case mnErrDeviceUnavailable             ' ┤φ╬≤ 68
  26.             strMsg = "╔Φ▒╕▓╗┐╔╙├"
  27.             intMsgType = vbExclamation + vbOKCancel
  28.         Case mnErrDiskNotReady                  ' ┤φ╬≤ 71
  29.             strMsg = "╘┌╟²╢»╞≈╓╨▓σ╚δ╥╗╒┼╚φ┼╠▓ó╣╪║├╟²╢»╞≈╨í├┼"
  30.             intMsgType = vbExclamation + vbOKCancel
  31.         Case mnErrDeviceIO                      ' ┤φ╬≤ 57
  32.             strMsg = "─┌▓┐┤┼┼╠┤φ╬≤"
  33.             intMsgType = vbExclamation + vbOKOnly
  34.         Case mnErrDiskFull                      ' ┤φ╬≤ 61
  35.             strMsg = "┤┼┼╠╥╤┬·ú¼╝╠╨°┬≡ú┐"
  36.             intMsgType = vbExclamation + vbAbortRetryIgnore
  37.         Case mnErrBadFileName, mnErrBadFileNameOrNumber ' ┤φ╬≤ 64 & 52
  38.             strMsg = "╬─╝■├√╖╟╖¿"
  39.             intMsgType = vbExclamation + vbOKCancel
  40.         Case mnErrPathDoesNotExist                ' ┤φ╬≤ 76
  41.             strMsg = "┬╖╛╢▓╗┤µ╘┌"
  42.             intMsgType = vbExclamation + vbOKCancel
  43.         Case mnErrBadFileMode                     ' ┤φ╬≤ 54
  44.             strMsg = "▓╗─▄╥╘┤╦└α╖├╬╩┤≥┐¬╬─╝■"
  45.         Case mnErrFileAlreadyOpen             ' ┤φ╬≤ 55
  46.             strMsg = "╬─╝■╥╤╛¡▒╗┤≥┐¬"
  47.             intMsgType = vbExclamation + vbOKOnly
  48.         Case mnErrInputPastEndOfFile              ' ┤φ╬≤ 62
  49.             strMsg = "╬─╝■╙╨╥╗╕÷▓╗▒Ω╫╝╡─╬─╝■╜ß╩°▒Ω╓╛ú¼"
  50.             strMsg = strMsg & "╗≥╞≤═╝╢┴╬─╝■╜ß╩°▒Ω╓╛╓«║≤"
  51.             strMsg = strMsg & "╡──┌╚▌"
  52.             intMsgType = vbExclamation + vbAbortRetryIgnore
  53.         Case Else
  54.             FileErrors = 3
  55.             Exit Function
  56.     End Select
  57.     intResponse = MsgBox(strMsg, intMsgType, "┤┼┼╠┤φ╬≤")
  58.     Select Case intResponse
  59.         Case 1, 4       ' ╚╖╢¿, ╓╪╩╘ ░┤┼Ñ
  60.             FileErrors = 0
  61.         Case 2, 5       ' ╚í╧√, ║÷┬╘ ░┤┼Ñ
  62.             FileErrors = 1
  63.         Case 3          ' ╓╨╓╣ ░┤┼Ñ
  64.             FileErrors = 2
  65.         Case Else
  66.             FileErrors = 3
  67.     End Select
  68. End Function
  69.  
  70.