[TRUCO DELPHI] Algunas rutinas para crear archivos HTML.
delphi
function SpacesToPluses(Str: String): String; Var i: Integer; begin For i := 1 To Length(Str) Do begin If Str[i] = #32 Then Str[i] := '+'; end; Result := Str; end; function AddQuotes(Const Str: String): String; begin Result := Format('"%s"', [Str]); end; function MakeBold(Const Str: String): String; begin Result := Format('<b>%s&</b>', [Str]); end; function MakeItalic(Const Str: String): String; begin Result := Format('<i>%s</i>', [Str]); end; function MakeMailTo(Address, Name, Subject: String): String; begin If Subject > '' Then Address := Address + '?Subject=' + Subject; Result := Format('<a href="mailto:%s">%s</a>', [Address, Name]); end; function MakeLink(Const URL, Name: String): String; begin Result := Format('<a href=%s>%s</a>', [AddQuotes(URL), Name]); end; function MakeHTMLParam(Const Str: String): String; begin Result := AddQuotes(SpacesToPluses(Str)); end;
Saludos!