README.md

December 5, 2022 ยท View on GitHub

ReadFile

Description

Read an entire text file into a string in one call.

More Info

sFileName As String

String containing file contents.

Submitted On
ByJames Vincent Carnicelli
LevelUnknown
User Rating4.8 (19 globes from 4 users)
CompatibilityVB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryString Manipulation
WorldVisual Basic
Archive File

Source Code

Public Function ReadFile(ByVal sFileName As String) As String
  Dim fhFile As Integer
  fhFile = FreeFile
  Open sFileName For Binary As #fhFile
  ReadFile = Input$(LOF(fhFile), fhFile)
  Close #fhFile
End Function