Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Sample Controls/TSpinEdit    [ Add a report in this area ]  
Report #:  99397   Status: Open
TSpinEdit raises exception in GetValue
Project:  Delphi Build #:  16.0.4256.43595
Version:    16.0 Submitted By:   Stefan Glienke
Report Type:  Suggestion / Enhancement Request Date Reported:  9/28/2011 6:27:07 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   288716
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The code of GetValue looks like this:

function TSpinEdit.GetValue: LongInt;
begin
  try
    Result := StrToInt (Text);
  except
    Result := FMinValue;
  end;
end;

This causes an exception every time the text is not a valid number. A solution would be to change this method:

function TSpinEdit.GetValue: LongInt;
begin
  Result := StrToIntDef(Text, FMinValue);
end;
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01