rejetto forum

after the end, and special:end

Mars · 2 · 3447

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
 There is already of it certain time, rejetto created, further to my request, one macro 'AFTER THE LIST'.
 On the same principle, I decided to add a macro one named 'AFTER THE END'. and a new section [special:end]  which is the opposite of [special:begin] ;)

Quote

....

type
  TmacroData = record
    cd: TconnData;
    tpl: Ttpl;
    folder, f: Tfile;
    afterTheList, afterTheEnd, archiveAvailable, hideExt: boolean;
    aliases: THashedStringList;
    table: TStringDynArray;
    end;

.........

    if name = 'after the list' then
      if md.afterTheList then
        result:=macroDequote(p)
      else
        result:=MARKER_OPEN+fullMacro+MARKER_CLOSE;

    if name = 'after the end' then
      if md.afterTheEnd then
        result:=macroDequote(p)
      else
        result:=MARKER_OPEN+fullMacro+MARKER_CLOSE;


    if name = 'breadcrumbs' then
      breadcrumbs();
........

  result:=diffTpl[''];
  md.f:=NIL;
  md.afterTheList:=TRUE;
  try tryApplyMacrosAndSymbols(result, md)
  finally md.afterTheList:=FALSE end;
 // here is apply the macro 'after the list'
  md.afterTheEnd:=TRUE;
  try tryApplyMacrosAndSymbols(result, md)
  finally end;


  applySequential();

// it is important to put the section 'special:end' here
 list:=diffTpl['special:end'];
  try tryApplyMacrosAndSymbols(list, md)
  finally end;


  // ensure this is the last symbol to be translated
  result:=xtpl(result, [
//removed    '\n', CRLF,
    '%build-time%', floatToStrF((now()-buildTime)*SECONDS, ffFixed, 7,3)
  ]);
finally
  folder.unlock();
  diffTpl.free;
  end;
end; // getFolderPage

'after the end' and 'special:end' seem capable of making the same work, the first one allows a job giving result on the web page, whereas the last one serves to make invisible actions at the end of section.

usage: {.after the end|{:  ______   :}.}

example with a diff template on a virtual folder

Quote
%sequential%
{.after the end|{:max={.^max.}  {.set|max|-9999.}:}.}
{.set|max|1000.}

%sequential%
max={.^max.}
{.inc|max|500.}

%sequential%
{.after the end|{:max={.^max.}:}.}

%sequential%
max={.^max.}
{.inc|max|1000.}

1
max=2500

2
max=1000

3
max=-9999

4
max=1500



« Last Edit: February 04, 2010, 09:59:50 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i guess you made these things because you faced impossibility at making something you needed. isn't it?
would you please tell me this real case instead?