"Dmitry Voroshin" <parix3-JGs/[EMAIL PROTECTED]> wrote in message news:[EMAIL 
PROTECTED]
> 
> Если речь идёт про Delphi 7 то эта конструкция работает после установки
> Update1. Тут не в IBX дело, а в TLargeIntField.

Интресно ЧТО МОЖНО НАКОСЯЧИТЬ В ЭТОМ КОДЕ?

{ TLargeintField }

constructor TLargeintField.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  SetDataType(ftLargeint);
  ValidChars := ['+', '-', '0'..'9'];
end;

procedure TLargeintField.CheckRange(Value, Min, Max: Largeint);
begin
  if (Value < Min) or (Value > Max) then RangeError(Value, Min, Max);
end;

function TLargeintField.GetAsFloat: Double;
begin
  Result := GetAsLargeint;
end;

function TLargeintField.GetAsInteger: Longint;
var
  L: LargeInt;
begin
  if GetValue(L) then Result := Longint(L) else Result := 0;
end;

function TLargeintField.GetAsLargeint: Largeint;
begin
  if not GetValue(Result) then Result := 0;
end;

function TLargeintField.GetAsString: string;
var
  L: Largeint;
begin
  if GetValue(L) then Str(L, Result) else Result := '';
end;

function TLargeintField.GetAsVariant: Variant;
begin
  if IsNull then
    Result := Null else
  begin
    TVarData(Result).VType := VT_DECIMAL;
    Decimal(Result).lo64 := GetAsLargeInt;
  end;
end;

function TLargeintField.GetDataSize: Integer;
begin
  Result := SizeOf(Largeint);
end;

function TLargeintField.GetDefaultWidth: Integer;
begin
  Result := 15;
end;

procedure TLargeintField.GetText(var Text: string; DisplayText: Boolean);
var
  L: Largeint;
  FmtStr: string;
begin
  if GetValue(L) then
  begin
    if DisplayText or (FEditFormat = '') then
      FmtStr := FDisplayFormat else
      FmtStr := FEditFormat;
    if FmtStr = '' then Str(L, Text) else Text := FormatFloat(FmtStr, L);
  end else
    Text := '';
end;

function TLargeintField.GetValue(var Value: Largeint): Boolean;
begin
  Result := GetData(@Value);
end;

procedure TLargeintField.SetAsFloat(Value: Double);
begin
  SetAsLargeint(Round(Value));
end;

procedure TLargeintField.SetAsInteger(Value: Longint);
begin
  SetAsLargeInt(Value);
end;

procedure TLargeintField.SetAsLargeint(Value: Largeint);
begin
  if (FMinValue <> 0) or (FMaxValue <> 0) then
    CheckRange(Value, FMinValue, FMaxValue);
  SetData(@Value);
end;

procedure TLargeintField.SetAsString(const Value: string);
var
  E: Integer;
  L: Largeint;
begin
  if Value = '' then Clear else
  begin
    Val(Value, L, E);
    if E <> 0 then DatabaseErrorFmt(SInvalidIntegerValue, [Value, DisplayName]);
    SetAsLargeint(L);
  end;
end;

procedure TLargeintField.SetVarValue(const Value: Variant);
begin
  AccessError('Variant');
end;

Ответить