Lua 関数の Import は、XML形式の Lua テーブルをインポートするために用いられます。
この Lua 関数は、Export と互いに関連しています。
Import(string:filename): table:content
Returns: nothing
"mySettings.xml" というテーブルをインポートするには、以下のようなコードでプラグインを作成します。
local function main()
local mySettings = {
count = 10,
indices = {1, 2, 3, 4},
names = "SomeString"
}
local importPath = GetPath(Enums.PathType.Library) .. "/mySettings.xml"
local importedTable = Import(importPath)
Printf("Imported table from " .. importPath)
Printf("Imported count = " .. importedTable.count)
Printf("Imported names = " .. importedTable.names)
for index in pairs(importedTable.indices) do
Printf("Index = " .. index)
end
end
return main
Command Line History には以下のように表示されます。
