en:freefile [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:freefile

## Freefile (Function)

### Format

freefile
freefile ( )

returns positive_integer_value

### Description

BASIC256 allows for multiple files to be opened at a single time. The freefile function returns a free file_number that you can use in your next Open or Openb. Once a file is closed, freefile will return that file_number to the list of available file numbers and may reissue that number.

### Example

    # copy one binary file to another
    k = 0
    source = freefile
    openb source,"file.pdf"
    dest = freefile
    openb dest,"file_copy.pdf"
    reset dest
    while not eof(source)
       writebyte dest, readbyte(source)
       k++
    end while
    close dest
    close source
    print k + " bytes copied."

### See Also

Changedir, Close, Currentdir, Dir, Eof, Exists, Freefile, Kill, Open, Openb, Read, Readbyte, Readline, Reset, Seek, Size, Write, Writebyte, Writeline

### History

0.9.9.17 | New to Version

en/freefile.txt · Last modified: 2014/02/08 18:39 by admin