Static data load

From Sim Innovations Wiki
Revision as of 16:04, 28 August 2018 by Admin (talk | contribs) (→‎Arguments)
Jump to navigation Jump to search

Description

static_data_load(path, callback)
static_data_load(path, options, callback)

static_data_load is used to get load static data from a XML, JSON or CSV file.

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 path String The location of the static file inside the resource folder (*.xml or *.json).
2 callback Function Function is called when data has been loaded. Data argument contains the data, is nil on error.

Example

static_data_load("my_file.xml", function(data)
  if data ~= nil then
    -- Do something with your data
  else
    print("Failed to load static data")
  end
end)