#hws
func doCalc()
fvar(a)
a = copy(MathStr, 1, 1)
event(onResult,e_str(a))
end
А этот работает:
#hws
func doCalc()
fvar(a)
a = copy(MathStr, 1, 2)
event(onResult,e_str(a))
end
То-есть, если я, из строки, копирую один символ - наступает крах, если больше - то нет.
Если кеширую результат в переменную, то работает и с одним символом, но это лишние такты.
Целевой код такой:
#pas
procedure TClassFTCG_Tools_8EA8840.event_doData(var Data:TData; index:word);
begin
MessageBox(0, PChar('e'), PChar(''), MB_OK);
end;
#pas
procedure TClassFTCG_Tools_8EA8840.event_doData(var Data:TData; index:word);
begin
MessageBox(0, PChar('ex'), PChar(''), MB_OK);
end;
Вот не работающий, целевой, код целиком.
#pas
unit hiFTCG_Tools_8EA8840;
interface
uses windows,kol,Share,hiFTCG_Tools_EM,ftcg_share;
type
TClassFTCG_Tools_8EA8840 = class(TFTCG_Tools_EM)
private
function readData(index:word):TData;
function readDataInt(index:word):integer;
function readDataStr(index:word):string;
function readDataReal(index:word):real;
public
constructor Create(_Control:PControl);
destructor Destroy; override;
procedure event_doData(var Data:TData; index:word);
procedure event_do_in(var Data:TData; index:word);
procedure event_doInterval(var Data:TData; index:word);
procedure event_doInterval1(var Data:TData; index:word);
procedure event_doStop(var Data:TData; index:word);
procedure event_doInterval2(var Data:TData; index:word);
end;
function Create_hiFTCG_Tools_8EA8840(Control:PControl):TFTCG_Tools_EM;
implementation
uses hiFTCG_Tools;
function Create_hiFTCG_Tools_8EA8840;
begin
Result := TClassFTCG_Tools_8EA8840.Create(Control);
end;
constructor TClassFTCG_Tools_8EA8840.Create;
begin
inherited Create(_Control);
SetLength(doWork, 6);
SetLength(getVar, 0);
doWork[0] := event_doData;
doWork[1] := event_do_in;
doWork[2] := event_doInterval;
doWork[3] := event_doInterval1;
doWork[4] := event_doStop;
doWork[5] := event_doInterval2;
end;
destructor TClassFTCG_Tools_8EA8840.Destroy;
begin
inherited Destroy;
end;
function TClassFTCG_Tools_8EA8840.readData;
begin
dtNull(Result);
_ReadData(Result, THIFTCG_Tools(FParent).Datas[index]);
end;
function TClassFTCG_Tools_8EA8840.readDataInt;
var dt:TData;
begin
dtNull(dt);
_ReadData(dt, THIFTCG_Tools(FParent).Datas[index]);
Result := ToInteger(dt);
end;
function TClassFTCG_Tools_8EA8840.readDataStr;
var dt:TData;
begin
dtNull(dt);
_ReadData(dt, THIFTCG_Tools(FParent).Datas[index]);
Result := ToString(dt);
end;
function TClassFTCG_Tools_8EA8840.readDataReal;
var dt:TData;
begin
dtNull(dt);
_ReadData(dt, THIFTCG_Tools(FParent).Datas[index]);
Result := ToReal(dt);
end;
procedure TClassFTCG_Tools_8EA8840.event_doData(var Data:TData; index:word);
begin
MessageBox(0, PChar('e'), PChar(''), MB_OK);
end;
procedure TClassFTCG_Tools_8EA8840.event_do_in(var Data:TData; index:word);
begin
end;
procedure TClassFTCG_Tools_8EA8840.event_doInterval(var Data:TData; index:word);
begin
end;
procedure TClassFTCG_Tools_8EA8840.event_doInterval1(var Data:TData; index:word);
begin
end;
procedure TClassFTCG_Tools_8EA8840.event_doStop(var Data:TData; index:word);
begin
end;
procedure TClassFTCG_Tools_8EA8840.event_doInterval2(var Data:TData; index:word);
begin
end;
end.