home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Basic / GridOne / setup.EXE / BLOB.BAS < prev    next >
Encoding:
BASIC Source File  |  2001-09-09  |  716 b   |  36 lines

  1. Attribute VB_Name = "modBLOB"
  2. Option Explicit
  3.  
  4. Private Const BlockSize = 32768
  5.  
  6.  
  7. Function ReadFile(sFileName As String) As Variant
  8.    
  9.     Dim i As Integer
  10.     Dim FileLength As Long, LeftOver As Long
  11.     Dim RetVal As Variant
  12.  
  13.     ' Open the source file.
  14.     Dim hFile As Integer
  15.     hFile = FreeFile
  16.     Open sFileName For Binary Access Read As hFile
  17.  
  18.     ' Get the length of the file.
  19.     Dim nFileSize As Long
  20.     nFileSize = LOF(hFile)
  21.     If nFileSize = 0 Then
  22.         ReadFile = Empty
  23.         Exit Function
  24.     End If
  25.  
  26.     ' Read file
  27.     Dim arrData() As Byte
  28.     ReDim arrData(nFileSize)
  29.     Get hFile, , arrData
  30.     Close hFile
  31.     
  32.     ReadFile = arrData
  33.  
  34. End Function
  35.  
  36.