Defines a string column with the given name. This and all of the other Page.Type functions are passed to New() to define the structure of each row. When tables are saved to the Page, the column name defines the key to search for a string value. In addition, tables obtained from the Page will have a key identified by the column name filled with a string value.

Definition

Column String (String name, int length)

Arguments

  • String name The name of the column.
  • int length The maximum number of characters in the string.

Returns

Returns a Column object which is passed in an array to New().

Example

local myPage = Page.New("myPage", 32, {
    Page.Type.String ("Name", 64),
    Page.Type.Number "Score",
    Page.Type.Bool "IsBanned",
})

myPage:Set(0, {
    Name = "Joe",
    Score = 0,
    IsBanned = true,
})

local row = myPage:Get(0)
print(row.Name)