SecondBASIC Documentation v3

Home / Command Reference / DataFile

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.

Syntax:

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.

Example:

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