Creates a new page with the given name, initial size, and row structure. This function errors if a page already exists with the given name. You may consider calling New()
once and then rewriting your RBXMod to call Load()
instead. Used with the Page.Type
functions to define a structure for the rows.
Definition
Page New (String name, int initial_num_rows, array row_structure)
Arguments
String name
The name of the page. Used to load it in future instances of the RBXMod. Names are RBXMod-specific and pages cannot be shared with other RBXMods.int initial_num_rows
The number of rows to allocate. This number is multiplied by the bytes required by the row structure to define the total memory requirements of the file. The entire file is allocated at once and can be reallocated with the:Resize()
method later.array row_structure
This parameter is an array of calls toRBXMod.Type
. The array defines the order the columns are stored in memory.RBXMod.Type
functions take in the column name along with any other relavent parameters like string length. See the example below.
Returns
Returns a Page object. This is a userdata.
Example
local myPage = Page.New("myPage", 32, { Page.Type.String ("Name", 64), Page.Type.Number "Score", Page.Type.Bool "IsBanned", })