Starnge code in acDBGrid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37369
    HeDiBo
    Participant

    This is some code in acDBGrid (v11.26):

    Code:
    function IsDigits(const Value: string): boolean;
    var
    i: integer;
    begin
    Result := True;
    for i := 1 to Length(Value) do
    if not (Value in ['1'..'0']) then begin //WHAT?????
    Result := False;
    Exit;
    end;
    end;

    My version of Delphi produces a warning:

    Code:
    W1050 WideChar reduced to byte char in set expressions. Consider using 'CharInSet' function in 'SysUtils' unit.

    But that's not the problem: Value in ['1'..'0'] will always be False!! I tested the version with the more reasonable ['0' .. '9'] and it did work when the column of the grid became too small for the numeric value.

    #56252
    Support
    Keymaster

    You are right, this is an error. The code will be changed in the nearest release, thank you for the message.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.