lisnic, А так?
Add(MainForm,2953706,308,182) { Width=382 Height=295 } Add(InlineCode,7442695,427,280) { WorkPoints=#6:doCode| EventPoints=#5:onRes| DataPoints=#4:Data|3:Key| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|0:|9: public|19: Data: THI_Event;|18: Key: THI_Event;|20: onRes: THI_Event;|3: |51: procedure doCode(var _Data: TData; Index: Word);|5: end;|76: function XorEncodeDecode(const aStr: String; const aKey: String): String;|0:|14:implementation|0:|59:procedure THiAsmUnit.doCode(var _Data: TData; Index: Word);|18:var str,ky:string;|5:begin|32: str := ReadString(_Data,data);|30: ky := ReadString(_Data,Key);|44: _hi_OnEvent(onRes,XorEncodeDecode(str,ky));|4:end;|0:|73:function XorEncodeDecode(const aStr: String; const aKey: String): String;|3:var|14:j, i: Integer;|5:begin|32: if (aKey='') or (aStr='') then|15: Result:=aStr|6: else|8: begin|9: i:=1;|35: SetLength(Result,Length(aStr));|31: for j:=1 to Length(aStr) do|10: begin|28: if i>Length(aKey) then|12: i:=1;|55: Result[j]:=Char(Byte(aStr[j]) xor Byte(aKey[i]));|13: inc(i);|9: end;|7: end;|4:end;|0:|4:end.| link(OnRes,13326622:doWork2,[]) link(Key,15764081:Text,[]) } Add(VisualStrings,15764081,434,231) { Lines=#9:Vitalicus| Width=60 } Add(StreamConvertor,13503036,357,280) { Mode=3 Charset=3 link(onResult,7442695:doCode,[]) } Add(Button,2643349,287,280) { Left=25 Top=15 Data=String(675b47) link(onClick,13503036:doConvert,[]) AddHint(-15,-25,61,13,Data) } Add(Button,452915,287,385) { Left=110 Top=15 Caption="123" Data=String(123) link(onClick,11991779:doCode,[]) AddHint(-15,-25,43,13,Data) } Add(InlineCode,11991779,392,385) { WorkPoints=#6:doCode| EventPoints=#5:onRes| DataPoints=#4:Data|3:Key| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|0:|9: public|19: Data: THI_Event;|18: Key: THI_Event;|20: onRes: THI_Event;|3: |51: procedure doCode(var _Data: TData; Index: Word);|5: end;|76: function XorEncodeDecode(const aStr: String; const aKey: String): String;|0:|14:implementation|0:|59:procedure THiAsmUnit.doCode(var _Data: TData; Index: Word);|18:var str,ky:string;|5:begin|32: str := ReadString(_Data,data);|30: ky := ReadString(_Data,Key);|44: _hi_OnEvent(onRes,XorEncodeDecode(str,ky));|4:end;|0:|73:function XorEncodeDecode(const aStr: String; const aKey: String): String;|3:var|14:j, i: Integer;|5:begin|32: if (aKey='') or (aStr='') then|15: Result:=aStr|6: else|8: begin|9: i:=1;|35: SetLength(Result,Length(aStr));|31: for j:=1 to Length(aStr) do|10: begin|28: if i>Length(aKey) then|12: i:=1;|55: Result[j]:=Char(Byte(aStr[j]) xor Byte(aKey[i]));|13: inc(i);|9: end;|7: end;|4:end;|0:|4:end.| link(onRes,4409739:doConvert,[]) link(Key,254383:Text,[]) } Add(VisualStrings,254383,399,336) { Lines=#9:Vitalicus| Width=60 } Add(HubEx,13326622,504,280) { link(onEvent,10949635:doAdd,[]) } Add(StreamConvertor,4409739,441,385) { Mode=2 Charset=3 link(onResult,13326622:doWork3,[(508,391)]) } Add(Memo,10949635,532,280) { Left=10 Top=40 Width=335 Height=205 Ctl3D=1 ScrollBars=3 }
|