Tiedostot : funktiot

EOF


   KUVAUS

Käytä tätä funktiota kertomaan, onko tiedosto jo luettu loppuun. Se palauttaa 1, jos tiedosto on lopussa, ja nolla, jos lukeminen jatkuu vielä.

   KÄYTTÖ
EOF (tiedostomuuttuja)

  • tiedostomuuttuja = Se muuttuja, mihin tiedosto avattiin.

  •    ESIMERKKI
    'make window bigger as otherwise the text won't fit
    SCREEN 580,420,16,cbwindowed

    'open the file
    f=OpenToRead("Media\example.txt")

    textline=0

    'print the whole file to the screen
    While Not EOF(f)

        Text 0,textline,ReadLine(f)
        
        textline=textline+12

    Wend

    'show the screen
    DrawScreen

    'don't forget this!
    CloseFile f

    WaitKey

    <<TAKAISIN