Recent

Author Topic: Setting the value of Owned Object properties  (Read 484 times)

peardox

  • Jr. Member
  • **
  • Posts: 70
Setting the value of Owned Object properties
« on: May 28, 2020, 05:38:57 am »
I'm creating and adding objects to a TStringList in a procedure

In the calling procedure I'm then iterating over the list and looking for problem objects, specifically objects that are orphaned by not having a matching string in the string list

It all looks like it works - but it doesn't take

I then iterate over the StringList and set the object's Orphan value to False if I find a match (they are set to True by default in the constructor)

Once this is done I try counting up the number of orphaned objects - a sanity check at first (which failed)

All of them still have their Orphan property set to True even though I know some of them definitely were marked as orphans

I've written some illustrative code to help explain, it looked a bit long so I thought I'd just ask the shorter version of the question before overloading people with theoretical simplified code

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Setting the value of Owned Object properties
« Reply #1 on: May 28, 2020, 05:56:16 am »
Most probably there is something wrong in your code so you'll have to post it, after all. Sorry.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018