up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines
These functions allow you to manipulate person sets. A person set is a potentially large set of persons; each person may have an arbitrary value associated with him/her. A person set must be declared with the indiset function before it can be used.
Function | Description |
---|---|
void indiset(set_v) | Indiset creates and returns an empty set. Its parameter is a variable. Every set must be declared in this way. |
set addtoset(set, indi, any) | Addtoset adds a person to a set. The first argument is the set; the second argument is the person; and the third argument may be any value. The same person may be added to a set more than once, each time with a different value. |
set deletefromset(set, indi, bool) | Deletefromset removes a person from a set. The first argument is the set; the second argument is the person; if the third parameter is true all of the person's entries are removed from the set; if false only the first entry is removed. |
int lengthset(set) | Lengthset returns the number of persons in a person set. |
set union(set, set) | Union, intersect and difference take two person sets as arguments and return a third person set. The functions do not affect the values of their two argument sets. Union returns the set union of the two sets. |
set intersect(set, set) | Intersect returns the set intersection of the two sets. |
set difference(set, set) | Difference returns the set difference of the two sets. |
set parentset(set) | Parentset returns the set of all parents of the persons in the argument set. The argument set is not affected. |
set childset(set) | Childset returns the set of all children of the persons in the argument set. The argument set is not affected. |
set spouseset(set) | Spouseset returns the set of all spouses of the persons in the argument set. The argument set is not affected. |
set siblingset(set) | Siblingset returns the set of all siblings of the persons in the argument set. The argument set is not affected. |
set ancestorset(set) | Ancestorset returns the set of all ancestors of the persons in the argument set. The argument set is not affected. |
set descendentset(set) | Descendentset returns the set of all descendents of the persons in the argument set. The argument set is not affected. |
set descendantset(set) | Descendantset is the same function as descendentset. |
set uniqueset(set) | Uniqueset sorts a person set by key value and removes all entries with duplicate keys; the input set is modified and returned. |
void namesort(set) | Namesort sorts a set of persons by name. |
void keysort(set) | Keysort sorts a set of persons by key value. |
void valuesort(set) | Valuesort sorts a set of persons by user value. |
void genindiset(string, set) | Genindiset generates the set of persons that matches a string whose value is a name in GEDCOM format. Genindiset uses the same algorithm that matches names entered at the browse prompt or by the user interaction getindiset function. |
void gengedcom(set) | Gengedcom generates GEDCOM format output, to the report output file, of all persons in the argument person set. The output contains a person record for each person in the set, and all the family records that link at least two of the persons in the set together. |
forindiset(set, indi_v, any_v, int_v) { } | Forindiset is an iterator that loops through each person in an indiset. The first parameter is an indiset. The second parameter is a variable that iterates through each person in the set. The third parameter iterates through the values associated with the persons. The fourth parameter is an integer variable that counts the iterations. |
Each person in a person set has an associated value. When a person is added to a set with addtoset, the value is explicitly assigned. When new sets are created by other functions, a number of rules are used to associate values with persons as they are added to the new sets. For parentset, childset and spouseset the values are copied from the first input set person that causes the new person to be added to the set. For union, intersect and difference, the values are copied from the values in the first input set, except in the case of union, when persons are taken from the second set alone, in which case the values come from there. For ancestorset and descendantset the value is set to the number of generations the new person is away from the first person in the input set that the new person is related to. If the new person is related to more than one person in the input set, the value is set for the nearest relationship; that is, the value is as low as possible. Valuesort sorts a person set by the values of these auxiliary values.
up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines
1/1/00