[fpc-pascal] replace one field of a record in a collection...

Sven Barth pascaldragon at googlemail.com
Wed Feb 1 23:13:49 CET 2012


Am 01.02.2012 21:21 schrieb "waldo kitty" <wkitty42 at windstream.net>:
>
>
> i've gone brain dead after a few days at my $$$ job and i cannot figure
out how to replace one field of a record in a collection :/  i'm looking at
my existing code that does something similar but it is replacing the entire
record and that's too much as well as the fact that the two records i'm
working with are not the same...
>
> i'm building a record with data from a file... this record has a field
that is basically the joiner between two tables if we were talking
databases... all data is linked based on this field... there is another
field that contains some text... is it this text field that needs to be put
in place of the text field in the collection record if the two are not the
same..
>
> so, i'm creating a record to use for the collection's search function but
then when i find the record i'm seeking, i don't know how to replace its
text field... the more i look at the code and try to figure it out, the
more it looks like tarzan's squiggly bugs in the books that he learned to
read from :?

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.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120201/cef855bf/attachment.html>


More information about the fpc-pascal mailing list