zoukankan      html  css  js  c++  java
  • 软件项目快速简码查询之汉字处理

    Function GetStr(var Str:String;ADOQ:TADOQuery):TWbStr;
    var c,s,y,wb1,py1:AnsiString;
        i:Integer;
        a:integer;
        PR_WB:TWbStr;
    begin
        wb1:='';
        py1:='';
        s:='';
        c:=trim(Str);
        a:=1;
        for i:=1 to Length(c) do
        begin
          if   Length(c) div 2=Length(WideString(C))   then //测试判断是不是汉字
          begin
          y:=copy(c,a,2);
          with ADOQ do
          begin
             close;
             sql.Clear;
             sql.Add('select * from pr_code');
             sql.Add('where CHN=:CHN');
             Parameters.ParamByName('CHN').Value:=y;
             open;

             if Recordcount<>0 then
             begin
               wb1:=wb1+FieldbyName('WBH').AsString;
               py1:=PY1+FieldbyName('PYH').AsString;
             end;
             a:=a+2;
          end;
          end
          else
          begin
          y:=copy(c,a,1);
               wb1:=wb1+y;
               py1:=py1+y;
               a:=a+1;
          end;


       end;
      PR_WB.WB:=wb1;
      PR_WB.PY:=py1;
      ADOQ.Close;
     result:=PR_WB;
    end;

  • 相关阅读:
    没事千万不要升级VirtualBox和Vagrant!
    以太坊开源项目
    以太坊合约第三方库
    Redis dbfilename
    SUSE Redis 开机启动
    SUSE Linux Enterprise Server 12 SP3 安装redis 6.0以上版本
    HTML基础练习
    html基础
    关于css 浮动的例子
    css 实现三角形
  • 原文地址:https://www.cnblogs.com/carcode/p/1500067.html
Copyright © 2011-2022 走看看