Вверх ↑
Ответов: 16884
Рейтинг: 1239
#1: 2016-02-08 21:24:09 ЛС | профиль | цитата
Add(MainForm,2953706,21,105)
{
Width=707
Height=447
Point(onClose)
link(onCreate,13560031:doExecute,[(72,125)(72,104)])
link(onClose,2894498:doClose,[])
}
Add(SQLite_DB,2894498,133,119)
{
link(onOpen,10868581:doEvent1,[])
}
Add(InlineCode,507989,238,84)
{
@Hint=#13:Функция Upper|
WorkPoints=#11:addFunction|
DataPoints=#8:dbHandle|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|52:uses kol,Share,Debug,Windows,SQLite3Api,hiSQLite_DB;|0:|4:type|28: THiAsmClass = class(TDebug)|9: public|22: dbHandle:THI_Event;|52: procedure addFunction(var _Data:TData; idx:word);|5: end;|0:|14:implementation|0:|13:var s:string;|65:procedure myFunc(ctx:pointer; nArg:integer; args:ppvalue); cdecl;|5:begin|31: s:=sqlite3_value_text(args^);|33: CharUpperBuff(@s[1],Length(s));|48: sqlite3_result_text(ctx,PChar(s),Length(s),0);|4:end;|0:|34:procedure THiAsmClass.addFunction;|13:var dt:TData;|5:begin|37: dt := ReadData(_Data,dbHandle,nil);|41: if _IsObject(dt,SQLite_GUID) then begin|90: sqlite3_create_function(ToObject(dt),PChar('UPPER'),1,SQLITE_ANY,nil,@myFunc,nil,nil);|6: end;|4:end;|0:|4:end.|
AddHint(-45,-43,93,13,@Hint)
}
Add(ODialog,13560031,77,98)
{
link(onExecute,2894498:doOpen,[(117,104)(117,125)])
}
Add(Hub,10868581,182,119)
{
OutCount=4
link(onEvent1,507989:addFunction,[(217,125)(217,90)])
link(onEvent2,11586007:addFunction,[])
link(onEvent3,5104807:doQuery,[(236,139)(236,174)])
link(onEvent4,14178118:doQuery,[(228,146)(228,237)])
}
Add(SQLite_Query,5104807,259,168)
{
SQL="SELECT info FROM elements WHERE Lower(info) LIKE '%ком%';"
link(onQuery,1726822:doAdd,[])
}
Add(ListBox,1726822,315,168)
{
Left=15
Top=15
Width=290
Height=380
}
Add(InlineCode,11586007,280,126)
{
@Hint=#13:Функция Lower|
WorkPoints=#11:addFunction|
DataPoints=#8:dbHandle|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|52:uses kol,Share,Debug,Windows,SQLite3Api,hiSQLite_DB;|0:|4:type|28: THiAsmClass = class(TDebug)|9: public|22: dbHandle:THI_Event;|52: procedure addFunction(var _Data:TData; idx:word);|5: end;|0:|14:implementation|0:|13:var s:string;|65:procedure myFunc(ctx:pointer; nArg:integer; args:ppvalue); cdecl;|5:begin|31: s:=sqlite3_value_text(args^);|33: CharLowerBuff(@s[1],Length(s));|48: sqlite3_result_text(ctx,PChar(s),Length(s),0);|4:end;|0:|34:procedure THiAsmClass.addFunction;|13:var dt:TData;|5:begin|37: dt := ReadData(_Data,dbHandle,nil);|41: if _IsObject(dt,SQLite_GUID) then begin|90: sqlite3_create_function(ToObject(dt),PChar('LOWER'),1,SQLITE_ANY,nil,@myFunc,nil,nil);|6: end;|4:end;|0:|4:end.|
AddHint(9,-46,93,13,@Hint)
}
Add(SQLite_Query,14178118,259,231)
{
SQL="SELECT info FROM elements ORDER BY Upper(info);"
link(onQuery,4280539:doAdd,[])
}
Add(ListBox,4280539,315,231)
{
Left=325
Top=15
Width=350
Height=380
}


А я подключаю две своих функции и никаких проблем с русским языком.

( В примере используется файл Elements\Delphi\Elements.db)
карма: 25
Немного терпения! Дежурный экстрасенс скоро свяжется с Вами!
0