SecondBASIC Documentation v3

Home / Command Reference / DataFile


Description: Inserts data into the ROM from an external file that can be read by the Read, ReadInt, and ReadLong commands, as well as the Read(), ReadInt(), and ReadLong&() functions.


DataFile <file> [, <type>]

Part Description
<file> Required. Path\File to insert into your program.
<type> Optional. Valid values are @Asm, @Txt, Txt, @Bin, and Bin. @Bin and Bin are identical, and @Asm, @Txt, and Txt are identical. The default <type> is @Asm.

Notes: If the file path is omitted, then the project's root folder will become the default path to the file. If the project hasn't previously been saved, the default path will be the path where SecondBASIC was installed to, which may cause errors if the project is saved. It is recommended to use quotations when specifying the path to the file.


        LoadTiles MyTiles,10,500
        Reload MyIntegers
        ReadInt c
        Print c
        DataFile graphics\my_tiles, @Bin
        DataFile "c:\dev\my_ints.asm"