unit ubasico;

interface
uses dialogs;

procedure gravaModeloBasico (nomeArq: string);

implementation

const modeloBasico: array[1..27] of string = (
    '<<<CABEÇALHO>>>',
    '<html lang="pt-br">',
    '<head>',
    '<title>[TÍTULO]</title>',
    '</head>',
    '<body>',
    '<h1>',
    '<img src="[LOGOTIPO]" border="0" alt="logotipo">',
    '&nbsp;&nbsp;',
    '[CABEÇALHO]',
    '</h1>',
    '<hr>',
    '<<<FIM>>>',
    '',
    '<<<TÓPICO>>>',
    '<h2>[TÓPICO]</h2>',
    '<<<FIM>>>',
    '',
    '<<<ASSINATURA>>>',
    '<hr>',
    '<a href="mailto:[EMAIL]">Envie carta para [AUTOR]</a>',
    '<h6>',
    'Licença Creative Commons 2.0 - 2002-2020 - InterCAP - NCE/UFRJ e HCTE/UFRJ<br>',
    '</h6>',
    '</body>',
    '</html>',
    '<<<FIM>>>');

procedure gravaModeloBasico (nomeArq: string);
var arq: textFile;
    i: integer;
begin
    assignFile (arq, nomeArq);
    {$I-} rewrite (arq); {$I+}
    if ioresult <> 0 then
        begin
            showMessage ('Modelo básico (modelo.mdl) não pode ser gravado');
            exit;
        end;

     for i := 1 to length(modeloBasico) do
        writeln (arq, modeloBasico[i]);
    closeFile (arq);
end;

end.


