View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004684 | JEDI VCL | 00 JVCL Components | public | 2009-01-30 19:17 | 2009-03-21 18:24 |
Reporter | acastiello | Assigned To | AHUser | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.35 | ||||
Target Version | Fixed in Version | 3.37 | |||
Summary | 0004684: TJvMemoryData fails to store and retrieve fields in Delphi 2009 | ||||
Description | Something as simple as: aJvMemoryData.FieldByName('fieldname').AsString := 'SomeValue'; fails Add aJvMemoryData.FieldByName('fieldname').AsString to the watches and you will always get and empty string! I traced the code and the problem seems to be in: function TJvMemoryData.GetFieldData(Field: TField; Buffer: Pointer): Boolean; function BufferLen(Buffer: {$IFDEF COMPILER12_UP}PByte{$ELSE}PChar{$ENDIF COMPILER12_UP}): Integer; this is the old code: function BufferLen(Buffer: {$IFDEF COMPILER12_UP}PByte{$ELSE}PChar{$ENDIF COMPILER12_UP}): Integer; begin {$IFDEF COMPILER12_UP} Result := 0; if Buffer <> nil then begin while Buffer[Result] <> 0 do Inc(Buffer); end; {$ELSE} Result := StrLen(Buffer); {$ENDIF COMPILER12_UP} end; this is my modified code: function BufferLen(Buffer: {$IFDEF COMPILER12_UP}PByte{$ELSE}PChar{$ENDIF COMPILER12_UP}): Integer; begin {$IFDEF COMPILER12_UP} Result := StrLen(PANSICHAR(Buffer)); {$ELSE} Result := StrLen(Buffer); {$ENDIF COMPILER12_UP} end; | ||||
Additional Information | locate in unit JvMemoryDataset; | ||||
Tags | No tags attached. | ||||
2009-01-30 19:17
|
JvMemoryDataset.pas (82,377 bytes) |
|
It would seem much more logical to me to replace Inc(Buffer) by Inc(Result) |
|
Yes, that would do too, (I tested it :D). I made with Strlen to a) Emphasize what BufferLen does b) get shorter and clearer code c) Not to code what is already coded :D Regards, Alvaro Castiello |
|
Fixed in SVN (rev. 12250) |
Date Modified | Username | Field | Change |
---|---|---|---|
2009-01-30 19:17 | acastiello | New Issue | |
2009-01-30 19:17 | acastiello | File Added: JvMemoryDataset.pas | |
2009-02-02 00:26 | obones | Note Added: 0015275 | |
2009-02-02 00:26 | obones | Status | new => feedback |
2009-02-02 10:14 | acastiello | Note Added: 0015286 | |
2009-03-21 18:24 | AHUser | Note Added: 0015323 | |
2009-03-21 18:24 | AHUser | Status | feedback => resolved |
2009-03-21 18:24 | AHUser | Fixed in Version | => Daily / SVN |
2009-03-21 18:24 | AHUser | Resolution | open => fixed |
2009-03-21 18:24 | AHUser | Assigned To | => AHUser |