Tiedostot : funktiot

READLINE


   KUVAUS

Lukee tekstitiedostosta rivin. Palauttaa siis merkkijonon.

   KÄYTTÖ
READLINE (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