View Issue Details

IDProjectCategoryView StatusLast Update
0001554JEDI VCL00 JVCL Componentspublic2004-04-01 08:55
ReporterDierkAssigned Touser72 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001554: TJvDriveCombo - index out of bounds
DescriptionSince revision 1.24 (Added Drives and DriveCount properties) I get an "index out of bounds" (free translated).
This only seems to be when changing JvDriveCombo.drivetypes:=[dtCDROM] in runtime.
Therefore I´ve looked to BUGReport 0001318 and delete the "change"-call after "Buildlist" in procedure TJvDriveCombo.SetDriveTypes.

Ok, now I get no more error, but problem is now again like in BUGReport 0001318.

Regards

Dierk
TagsNo tags attached.

Activities

user72

2004-04-01 02:46

  ~0003555

Last edited: 2004-04-01 02:46

Add the Change call again and replace Change with:

procedure TJvDriveCombo.Change;
  function FirstChar(const S: string): char;
  begin
    if Length(S) > 0 then
      Result := S[1]
    else
      Result := #0;
  end;
begin
  if ItemIndex <> -1 then
    FItemIndex := ItemIndex
  else
    FItemIndex := 0;
  if (FItemIndex >= 0) and (FItemIndex < FDrives.Count) then
    Drive := FirstChar(FDrives[FItemIndex]);
  if (ItemIndex > -1) and (ItemIndex < Items.Count) then
    FDisplayName := Items[ItemIndex]
  else
    FDisplayName := '';
  inherited Change;
end;

Works?

edited on: 04-01-04 02:46

Dierk

2004-04-01 02:52

reporter   ~0003560

Yop! This works!
But you´ve forget the "#" in Result:= #0

procedure TJvDriveCombo.Change;
  function FirstChar(const S: string): char;
  begin
    if Length(S) > 0 then
      Result := S[1]
    else
      Result := 0; <<-- should be #0

Thanks

Dierk

2004-04-01 02:53

reporter   ~0003561

Aah, bug-tracker deletes the "#" sign

user72

2004-04-01 04:21

  ~0003564

Yes, it thinks it's a link to a bug report...

Issue History

Date Modified Username Field Change
2004-04-01 00:44 Dierk New Issue
2004-04-01 02:46 user72 Note Added: 0003555
2004-04-01 02:46 user72 Note Edited: 0003555
2004-04-01 02:46 user72 Status new => assigned
2004-04-01 02:46 user72 Assigned To => user72
2004-04-01 02:52 Dierk Note Added: 0003560
2004-04-01 02:53 Dierk Note Added: 0003561
2004-04-01 04:21 user72 Note Added: 0003564
2004-04-01 08:55 user72 Status assigned => resolved
2004-04-01 08:55 user72 Resolution open => fixed