//********************** hiCopy.pas ************************************
procedure THICopy._work_doCopy;
var
  str:string;
  Pos,Count:integer;
begin
  str := ReadString(_Data,_data_Str,'');
  if str <> '' then begin
    Count := ReadInteger(_Data,_data_Count,_prop_Count);
    if Count < 0 then begin  //  ,    .
      Pos:=Length(str)+ Count + 1;
      Count:=Abs(Count) end
     else Pos := ReadInteger(_Data,_data_Position,_prop_Position);     
    if Pos<=0 then begin 
      Inc(Count,Pos-1);
      Pos := 1     end;
     _hi_CreateEvent(_Data,@_event_onCopy,Copy(str,Pos,Count));
  end;
end;

//*************************** hiTrim ************************************************
procedure THITrim._work_doTrim;
var st,sb,sl:integer;
    ch:char;
begin
  FRes := ReadString(_Data,_data_Text,'');
  sl:= Length(FRes);
  if sl > 0 then
   begin
     if _prop_Char = '' then ch := ' ' else ch := _prop_Char[1];
//  
     st := 1;
     while (st <= sl)and(FRes[st] = ch) do inc(st);
//  
     sb := sl;
     while (sb > 0)and(FRes[sb] = ch) do dec(sb);
    FRes := copy(FRes,st,sb-st+1);
   end;
  _hi_OnEvent(_event_onTrim,FRes);
end;