procedure SaveIni;
begin
  SetSetting('RowCount',edtRowCount.text);
end;

procedure OnSettingInit;
begin
  BeginUpdate;
  edtRowCount.text:=GetSetting('RowCount','3');
  EndUpdate;
end;

//--- 按下设置窗口的确定按钮时，触发此事件 ---
//通过设置返回值来改变是否允许确认,当result为False时不关闭设置窗口
function OnSettingClose(iResult);
var
  i:integer;
begin
  result:=true;
  try
    i:=StrToInt(edtRowCount.text);
    if (i<1) or (i>10) then
      raise('');
  except
    showmsg('无效的条数！');
    result:=false;
  end;
  
  if result then SaveIni;
end;

