Function

TfrmFrame.ExpandCommand

Module

fFrame

Last Modified

3/11/2015 8:41:44 AM

Comments

Tool Menu Events ------------------------------------------------------------------------- 

 look for 'macros' on the command line and expand them using current context

Visibility

Private

Owner

TfrmFrame

Declaration

function ExpandCommand(x: string): string;

Calls Hierarchy


TfrmFrame.ExpandCommand
 ├Substitute
 └MScalar

Called-By Hierarchy


   TfrmFrame.ExpandCommand
     TfrmFrame.ToolClick┘ 
TfrmFrame.SetUserTools┘   
TfrmFrame.FormCreate┘     

Calls

Name Declaration Comments
MScalar function MScalar(const x: string): string; -
Substitute procedure Substitute(const Key, Data: string); -

Called-By

Name Declaration Comments
TfrmFrame.ToolClick procedure ToolClick(Sender: TObject); -


Source

2011  function TfrmFrame.ExpandCommand(x: string): string;
2012  { look for 'macros' on the command line and expand them using current context }
2013  
2014    procedure Substitute(const Key, Data: string);
2015    var
2016      Stop, Start: Integer;
2017    begin
2018      Stop  := Pos(Key, x) - 1;
2019      Start := Stop + Length(Key) + 1;
2020      x := Copy(x, 1, Stop) + Data + Copy(x, Start, Length(x));
2021    end;
2022  
2023  begin
2024    if Pos('%MREF', x) > 0 then Substitute('%MREF',
2025      '^TMP(''ORWCHART'',' + MScalar('$J') + ',''' + DottedIPStr + ''',' + IntToHex(Handle, 8) + ')');
2026    if Pos('%SRV',  x) > 0 then Substitute('%SRV',  RPCBrokerV.Server);
2027    if Pos('%PORT', x) > 0 then Substitute('%PORT', IntToStr(RPCBrokerV.ListenerPort));
2028    if Pos('%DFN',  x) > 0 then Substitute('%DFN',  Patient.DFN);  //*DFN*
2029    if Pos('%DUZ',  x) > 0 then Substitute('%DUZ',  IntToStr(User.DUZ));
2030    Result := x;
2031  end;