Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tell if a parent has children?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00493408
Message ID:
00493578
Views:
23
>>>>Using vfp5...
>>>>
>>>>When I save my parent I need to set a flag in the parent table indicating
>>>>whether or not the parent has children. This really speeds up another
>>>>part of my app. I was going to do a locate during the save and see if
>>>>it finds any children. Is there some slick way to do this?
>>>
>>>Joe,
>>>
>>>If you're trying to determine whether or not a table is engaged as a parent to a related child table, look at the TARGET() function.
>>
>>No... I'm using a logical field in my parent to indicate if there are
>>children to process. That way as I'm looping my parent I don't
>>have to look for child records unless that flag is set.
>
>And you're trying to find only those records that have a child record or are you trying to determine whether or not to set the flag? If the former then SCAN FOR < expression > can do it. If the latter, test for EOF() in the child work area.

Thanks to everyone for your suggestions!
Previous
Reply
Map
View

Click here to load this message in the networking platform