halexam.txt

来自「一个Delphi解释器的例子」· 文本 代码 · 共 32 行

TXT
32
字号
Example of external variables usage in interpreter:


Var
  OV:string;
  OP:Integer;

function TForm1.HalComp1VarNameTOID(const S: String): Integer;
begin
  If s='OV' then Result:=0
  else
  If s='OP' then Result:=1
  else
   Result:=-1;
end;

procedure TForm1.HalComp1SetVar(ID: Integer; Value: Variant);
begin
  Case id of
  0: OV:=Value;
  1: OP:=Value;
  end;
end;

function TForm1.HalComp1GetVar(ID: Integer): Variant;
begin
  case id of
  0: Result:=OV;
  1: Result:=OP;
  end;
end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?