newfile

LuaFAR for Editor

newfile


hobj = far2_history.newfile (filename)

Parameters:
  filename : string

Returns:
  hobj     : history object (a table).

Description:
  - The function executes filename as a Lua script, in an empty
    environment table.

  - The script is assumed to contain Lua data in the global
    variable Data (a table).

  - The environment table is returned, with its field FileName
    set to the value of filename argument.

  - If the file filename was absent or failed to compile, then
    the field Data of the returned object is an empty table.

  - The returned history object hobj has four methods:
    hobj:field, hobj:setfield, hobj:serialize and hobj:save.