help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Procedures and functions] Reference for unit 'pwumain' (#powtils_main)

SetVar

Declaration

Source position: pwumain.pas line 197

procedure SetVar(

  const name: String;

  const value: String

);

Notes

Sets a variable to be used in webtemplateout or webformat as a {$macrovar} or $macrovar.

Use this function for example to set up variables that you will store in html template files.

Tips

This is equivalent to the SetWebVar function. The old SetWebVar is available for backwards compatibility.

Example

var
  macro: string;
begin
  macro:= 'blue';
  SetWebVar('macro', macro);
  // now output a template here containing your $macro or {$macro}
  // WebTemplateOut() 
  // or WebWriteF(), WebFormat(), etc.
end.  

See also

OutF, TemplateOut





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505