Tiedostot : komennot

CLOSEFILE


   KUVAUS

Käytä tätä komentoa sulkeaksesi ennestään avoinna olevan tiedoston.

Sinun tulisi sulkea tiedostot heti, kun et enää lue niitä.

   KÄYTTÖ
CLOSEFILE tiedosto

  • tiedosto = Tiedostomuuttuja.

  • Katso myös: OPENTOREAD, OPENTOWRITE, OPENTOEDIT

       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