Вверх ↑
Разработчик
Ответов: 26155
Рейтинг: 2127
#1: 2010-02-03 15:47:39 ЛС | профиль | цитата
Tad писал(а):
С твоей схемой компонент проще не получается

Да ничего сложного



Add(MainForm,2953706,203,189)
{
}
Add(InlineCode,1226154,301,231)
{
WorkPoints=#8:ReadData|
EventPoints=#4:ANSI|4:UTF8|7:UTF16BE|7:UTF16LE|7:UTF32BE|7:UTF32LE|6:Result|
DataPoints=#8:FileName|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|25: FileName: THI_Event;|12: Result,|10: ANSI,|10: UTF8,|13: UTF16BE,|13: UTF16LE,|13: UTF32BE,|25: UTF32LE : THI_Event;|53: procedure ReadData(var _Data:TData; Index:word);|0:|5: end;|0:|14:implementation|0:|31:procedure THiAsmClass.ReadData;|3:var|13: fn: string;|14: st: PStream;|14: c: cardinal;|5:begin|36: Fn := ReadString(_Data, FileName);|30: st := NewReadFileStream(Fn);|16: st.read(c, 4);|10: st.free;|59: if c and $00FFFFFF = $00BFBBEF then _hi_onEvent(UTF8, fn)|105: else if (c and $FFFF0000 <> $00000000) and (c and $0000FFFF = $0000FEFF) then _hi_onEvent(UTF16LE, fn) |104: else if (c and $FFFF0000 <> $00000000) and (c and $0000FFFF = $0000FFFE) then _hi_onEvent(UTF16BE, fn)|104: else if (c and $0000FFFF = $00000000) and (c and $FFFF0000 = $FEFF0000) then _hi_onEvent(UTF32BE, fn) |103: else if (c and $FFFF0000 = $00000000) and (c and $0000FFFF = $0000FEFF) then _hi_onEvent(UTF32LE, fn)|30: else _hi_onEvent(ANSI, fn); |27: _hi_onEvent(Result, c); |4:end;|0:|4:end.|
link(ANSI,703364:doWork1,[])
link(UTF8,703364:doWork2,[])
link(UTF16BE,703364:doWork3,[])
link(UTF16LE,703364:doWork4,[])
link(UTF32BE,703364:doWork5,[])
link(UTF32LE,703364:doWork6,[])
link(Result,2181068:doConvert,[])
}
Add(ODialog,10774586,252,231)
{
Filter="*.txt|*.txt"
link(onExecute,1226154:ReadData,[])
}
Add(Button,10009811,203,231)
{
Left=25
Top=30
link(onClick,10774586:doExecute,[])
}
Add(Edit,5668756,462,196)
{
Left=110
Top=30
Width=145
Text=""
}
Add(Convertor,2181068,406,273)
{
Mode=6
Digits=8
link(onResult,13974656:doText,[])
}
Add(StrList,12288541,406,189)
{
Strings=#4:ANSI|4:UTF8|7:UTF16BE|7:UTF16LE|7:UTF32BE|7:UTF32LE|
Point(doGetString)
Point(onGetString)
link(onGetString,5668756:doText,[])
}
Add(ChanelToIndex,703364,350,231)
{
Count=6
link(onIndex,12288541:doGetString,[])
}
Add(Edit,13974656,462,273)
{
Left=110
Top=55
Width=145
Text=""
}

карма: 22

0