On 2/1/2012 17:13, Sven Barth wrote:
Are you storing pointers to records in your collection? If so then just replace
the field's value. The change will then be immediately visible for every other
code part that holds a reference to this record.

thanks for your reply, sven... you've been a big help with your responses to my questions...

in answer to your question, yes... the collections are storing pointers to the records and the records are also pointers to the data (i think!)... i'm using this line to replace the data in the collection with the new data if they are not already the same...

    PSCRec(aSatCatColl^.At(idx))^.satname^ := asatname;

the data is changing but i'm suspecting that i need to be doing something more because with the above line in place, i'm getting a lot of errors like the following... i suspect the problem is that the data being replaced is a different length that the replacement data?? if i comment out the above line, my program runs with no errors at all...


Marked memory at $022847B8 invalid
Wrong signature $1DBA9722 instead of 9F406D83
  $004154DB
  $00415597
  $0042E321
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Heap dump by heaptrc unit
567275 memory blocks allocated : 27238499/28896072
521148 memory blocks freed     : 26693877/28221592
46127 unfreed memory blocks : 544622
True heap size : 5439488 (112 used in System startup)
True free heap : 1224336
Should be : 1812768
Call trace for block $014B5778 size 50
  $00406DD1 line 1073 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
  $00407515 line 1135 of satsort32.lpr
  $00413901
  $00413901
Call trace for block $022D63C8 size 13
  $00406DA8 line 1073 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $014D5A68 size 66560
  $00404903 line 760 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
  $F0F0F0F0
  $F0F0F0F0
  $F0F0F0F0
Marked memory at $022847B8 invalid
Wrong signature $1DBA9722 instead of 9F406D83
  $00416367
  $004154DB
  $00415597
  $0042E321
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284758 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Marked memory at $022846F8 invalid
Wrong signature $370627AA instead of AD6CB9AE
  $00416367
  $004154DB
  $00415597
  $0042E321
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $022881E0 size 6
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284698 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284638 size 10
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02288190 size 6
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $022845D8 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284578 size 11
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02288140 size 6
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284518 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Marked memory at $022844B8 invalid
Wrong signature $370627AA instead of 9AB2499C
  $00416367
  $004154DB
  $00415597
  $0042E321
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $022780A8 size 6
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284458 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02284398 size 19
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02278058 size 6
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
Call trace for block $02281E78 size 13
  $004048B2 line 759 of satsort32.lpr
  $00406BEE line 1042 of satsort32.lpr
  $0042C774
  $00407515 line 1135 of satsort32.lpr
  $00413901
  $00413901
[...]

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to