Using powtils you can write something like the example bellow, which I
consider cleaner and easier to maintain:

From: 
http://code.google.com/p/powtils/source/browse/dev#dev/examples/raw-template

program project1; {$IFDEF FPC}{$mode objfpc}{$H+}{$ENDIF} {$APPTYPE CONSOLE}

uses
  pwinit, pwmain;

var
  MyMacroVar: string;

begin
  MyMacroVar:= '<b>really, really</b> splendid and <i>nice</i> ';
  SetVar('MacroVar', MyMacroVar);
  { TemplateRaw is less secure than TemplateOut and allows special characters }
  TemplateRaw('template.htm');
end.

=========

<html>
<head>
</head>
<body>
 Hello, isn't it $MacroVar today?
</body>
</html>


-- 
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to