zoukankan      html  css  js  c++  java
  • 改良dbgrideh的文字过滤

    uses

       ehlibado;

    改良dbgrideh的文字过滤,原先过虑需要填%字符串%,修改后,直接填入所要搜索的字符串即可,相关代码:

     procedure TSTColumnFilterEh.InternalSetExpressionStr(const Value: String);

      procedure SetLookupKeyValues(var v: Variant);
      var
        i: Integer;
      begin
        if VarIsArray(Expression.Operand1) then
          for i := VarArrayLowBound(Expression.Operand1, 1) to VarArrayHighBound(Expression.Operand1, 1) do
            v[i] := CurrentListDataSet.Lookup(CurrentListField, v[i], CurrentKeyField)
        else
          v := CurrentListDataSet.Lookup(CurrentListField, v, CurrentKeyField)
      end;
    var s: string;       // add by cxg
    begin
      if Value <> '' then  // add by cxg
        if Pos('%', Value) = 0 then
          s := '%'+value+'%';
      ParseExpression(s);
      FExpressionStr := s;
      if (CurrentKeyField <> '') and (CurrentListDataSet <> nil) and (CurrentListField <> '') then
      begin
        if FExpression.Operator1 <> foNon then
          SetLookupKeyValues(FExpression.Operand1);
        if FExpression.Operator2 <> foNon then
          SetLookupKeyValues(FExpression.Operand2);
      end;
    end;
     

     

  • 相关阅读:
    二叉树后序遍历
    二叉树中序遍历
    二叉树的前序遍历
    字符串转整数
    DVWA靶场——File Inclusion(文件包含)
    DVWA-CSRF
    DVWA--COMMAND INJECTION
    DVWA练习一 暴力破解
    pikachu--SSRF
    pikachu---XXE
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940719.html
Copyright © 2011-2022 走看看