Skip to main content

LoadTable

This function was added in DSL 4

Description

Load a table from a file created by SaveTable.

function LoadTable(name) --[[ ... ]] end

Parameters

  • name: string - The name of the file to load the table from. This should be a relative path, such as data/my_table.lua. The file must exist and be readable.

Return Values

  • table: table - The loaded table. If the file does not exist or cannot be read, it returns nil.

Example

local myTable = LoadTable('data/my_table.lua')
if myTable then
print('Table loaded successfully:', myTable.name)
else
print('Failed to load table')
end

See Also