execute ibeblock (
  ActionID variant,
  SelectedNames variant,
  SelectedNamesFmt variant,
  SelectedTypes variant,
  ParentName variant = '',
  ParentNameFmt variant = '',
  ParentType variant)
RETURNS (
  ActionCaptions variant,
  ActionDescriptions variant,
  CloseForm boolean = FALSE)
as
begin
  CRLF = ibec_CRLF();

  sDesc = '<b>%s</b> <hr>This is description for <i>%s</i>. <p><b>HTML allowed!</b>';

  if (SelectedTypes[0] = __dboDomain) then
  begin
    ActionCaptions[1]  = 'Domain(s) example #1';
    ActionDescriptions[1]  = ibec_StringReplace(sDesc, '%s', ActionCaptions[1], __rfIgnoreCase + __rfReplaceAll);
    ActionCaptions[2]  = 'Domain(s) example #2';
    ActionCaptions[3]  = 'Domain(s) example #3';
  end;
  else if (SelectedTypes[0] = __dboTable) then
  begin
    ActionCaptions[21] = 'Table(s) example #1';
    ActionDescriptions[21]  = ibec_StringReplace(sDesc, '%s', ActionCaptions[21], __rfIgnoreCase + __rfReplaceAll);
    ActionCaptions[22] = 'Table(s) example #2';
    ActionCaptions[23] = 'Table(s) example #3';
  end;
  else if (SelectedTypes[0] = __dboProcedure) then
    ActionCaptions[41] = 'Procedure(s) example #1';

  if (ActionID is null) then
  begin
    suspend;
    exit;
  end;

  CloseForm = TRUE;

  sCap = ActionCaptions[ActionID];
  if (sCap is null) then
    sCap = '(no caption defined for the action)';
  sMes = 'Block ' + ibec_QuotedStr(sCap, '"') + CRLF + 'will be executed after your confirmation.' + CRLF +
         'Are you sure?';

  if (ibec_MessageDlg(sMes, __mtConfirmation, __mbYes + __mbNo) <> __mrYes) then
    Exit;

  s = 'Action ID: ' || ActionID || CRLF || CRLF || 'Following objects were selected' || CRLF ||
      '=================================' || CRLF;
  foreach (SelectedNames as SelName key NameIdx) do
  begin
    ibec_Progress('Processing ' + SelName + '...');
    s .= SelName + CRLF;
  end;


  ibec_Progress(CRLF + 'That''s all, folks!');
  ibec_ShowMessage(s);
end
