<p class="Paragraph">Použitím funkce Eof zabráníte výskytu chyb při pokusu o načítání za koncem souboru. Při použití příkazu Input nebo Get ke čtení ze souboru se ukazatel souboru posune o počet načtených bajtů. Pokud bude dosažen konec souboru, vrátí funkce Eof hodnotu TRUE (-1).</p>
<p class="P2">Příklad:</p>
<p class="PropText">Sub ExampleWorkWithAFile</p>
<p class="PropText">Dim iNumber As Integer</p>
<p class="PropText">Dim sZeile As String</p>
<p class="PropText">Dim aFile As String</p>
<p class="PropText">Dim sMsg as String</p>
<p class="PropText">aFile = "c:\data.txt"</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Output As #iNumber</p>
<p class="PropText">Print #iNumber, "First line of text"</p>
<p class="PropText">Print #iNumber, "Another line of text"</p>
<p class="PropText">Close #iNumber</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Input As iNumber</p>