compile_path method

Applies to
TForm2

Declaration
function compile_path(inp: string): String;

Implementation

function TForm2.compile_path(inp:String):String;
function GetWindowsDirectory: string;
var
  Buffer: array [0..MAX_PATH] of Char;
begin
  Windows.GetWindowsDirectory(Buffer, SizeOf(Buffer));
  Result := IncludeTrailingBackslash(Buffer);
end;
function GetWikiDate:String;
var d :String;
begin
DateTimeToString(d,'yyyy/mmmm/d',now);
Result:=d;
end;
var temp:String;
begin
temp:=inp;
StrReplace(temp,'%root%',root,[rfIgnoreCase, rfReplaceAll]);
StrReplace(temp,'%win%',GetWindowsDirectory,[rfIgnoreCase, rfReplaceAll]);
StrReplace(temp,'%rdl%',GetWindowsDirectory+'system32\rundll32.exe',[rfIgnoreCase, rfReplaceAll]);
StrReplace(temp,'%date%',GetWikiDate,[rfIgnoreCase, rfReplaceAll]);
Result:=temp;
End;


HTML generated by Time2HELP
http://www.time2help.com