📄 other.pas
字号:
unit other;
interface
uses
AdPort,ExtCtrls,ADODB,Classes,smthread,SysUtils;
function EncodeChinese(s:WideString):String;//中文格式编码,s为Unicode String
function DecodeChinese(InputStr:String):String;//中文格式解码
var
birth_yearadoquery:TADOQuery;//出生年
companyadoquery:TADOQuery;//公司属性
departmentadoquery:TADOQuery;//部门属性
jobadoquery:TADOQuery;//职位
occupationadoquery:TADOQuery;//职业
incomeadoquery:TADOQuery;//收入
addressadoquery:TADOQuery;//地址属性
groupadoquery:TADOQuery;//群组名
useradoquery:TADOQuery;//客户信息
rcyyadoquery:TADOQuery;//日常用语
jrwhadoquery:TADOQuery;//节日问候
gsxxadoquery:TADOQuery;//公司信息
zqzfadoquery:TADOQuery;//真诚祝福
sywhadoquery:TADOQuery;//商业问候
jddbadoquery:TADOQuery;//经典对白
ymgxadoquery:TADOQuery;//幽默搞笑
blxxadoquery:TADOQuery;//保留信息
taskadoquery:TADOQuery;//任务信息
connect_infoADOQuery:TADOQuery;//连接参数
adodbconnectionstring:string;//连接数据库属性
sm_sending_receiving:smioThread;//短信收发线程
smsApdComPort: TApdComPort;//收发信息的端口
comport:String;//与手机相连的串口
baud_speed:String;//波特率
serivce_tel:String;//短信服务中心号码
timeoutTimer:TTimer;//超时计数定时器对象
delete_rec_index:Integer;//当前要删除的短信息的索引值
implementation
function EncodeChinese(s:WideString):String;//中文格式编码,s为Unicode String
var
i,len:Integer;
cur:Integer;
t:String;
begin
Result:='';
len:=Length(s);
i:=1;
while i<=len do
begin
cur:=ord(s[i]);
//BCD转换
FmtStr(t,'%4.4X',[cur]);
Result:=Result+t;
inc(i);
end;
end;
function DecodeChinese(InputStr:String):String;//中文格式解码
var
Buf:array[0..300] of WideChar;
i,j:Integer;
begin
i:=0;
while i<Length(InputStr) do
begin
j:=StrToInt('0x'+Copy(InputStr,i+1,4));
Buf[i div 4]:=WideChar(j);
i:=i+4;
end;
Buf[i div 4]:=#0;
Result:=WideCharToString(Buf);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -