Hello,
I’m writing a plugin to maintain custom Flags on a group of individuals, but I’ve come to the point where I need some help, plz.
I’ve started with three scenarios when adding a new flag:
1. The individual has no flags i.e. no Flags item/attribute in the property page and the INDI record has no _FLGS tag
2. The individual previously had one or more flags that has been deleted, but the (empty) Flags item in the property page persists.
3. The individual has (other) existing flags
For starters I’ve learned that the value of the _FLGS tag is a comma separated list of flag names, and I can read this by using the function fhGetItemText(ptrIndiRecord,'~._FLGS'), and I can then add my new project to the list (scenario 3)
Q1: However, I can’t work out how to set the new value for the _FLGS tag! My logic tells me that the construction below should do it, but alas not.
ptrFlagItem = fhGetItemPtr(ptrIndiRecord,'~._FLGS')
bOK = fhSetValueAsText(ptrFlagItem, strFlagNames)
Q2: Another problem I have, is how to determine if the individual has an existing (empty) Flags item? In scenario 1 i expect i need to create the _FLGS tag first, and link it, before adding it's value,. In both scenarion 1 and 2 the function fhGetItemText(ptrToIndiRecord,'~._FLGS') returns an empty string.
Regards
Erik
* Request help with maintaining Flags for individuals
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Request help with maintaining Flags for individuals
Have you looked at Flags Add and Remove Function?
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
-
evinther
- Platinum
- Posts: 43
- Joined: 15 Feb 2009 09:43
- Family Historian: V7
- Location: Denmark
- Contact:
Re: Request help with maintaining Flags for individuals
Hello ColeValleyGirl,
No, I hadn't actaully seen this function. It works just perfectly.
What should we all do without helpful persons like yourself?
Thanks a lot!
Erik
No, I hadn't actaully seen this function. It works just perfectly.
What should we all do without helpful persons like yourself?
Thanks a lot!
Erik