SaveData

LuaFAR for Editor

SaveData


far2_dialog.SaveData(aDialog, aData)

Parameters:
  aDialog : a dialog object created by a NewDialog call
  aData   : a table to save data in from aDialog

Returns:
  nothing

Description:
  The function copies data from a dialog object aDialog to aData.

  - The following item types are supported by the function:
    DI_CHECKBOX, DI_RADIOBUTTON, DI_EDIT, DI_FIXEDIT, DI_LISTBOX,
    DI_COMBOBOX.
  
  - The following properties are saved by the function:
     - For DI_CHECKBOX, DI_RADIOBUTTON: only index 6 ("Selected").
     - For DI_LISTBOX, DI_COMBOBOX: only  field "SelectIndex"
       of index 6 ("ListItems").
     - For DI_EDIT, DI_FIXEDIT: only index 10 ("Data").

  - Data are saved by the names identical to the item names.

  - If an item has either of fields _noautosave or _noauto set to
    true, it is not saved.

Example:
  local dlg = far2_dialog.NewDialog()
  dlg.cbxCase = {"DI_CHECKBOX",10,4,0,0, 0, "","",0, "&Case sensitive"}
  dlg.cbxWord = {"DI_CHECKBOX",10,5,0,0, 0, "","",0, "&Whole words"}
  -- add other items
  -- call far.Dialog(...)
  local data = {}
  far2.dialog.SaveData(dlg, data)
  return data