Person Functions

STRING name(INDI, [BOOL]);

default name of

STRING fullname(INDI, BOOL, BOOL, INT);

many name forms of

STRING surname(INDI);

surname of

STRING givens(INDI);

given names of

STRING trimname(INDI, INT);

trimmed name of

EVENT birth(INDI);

first birth event of

EVENT death(INDI);

first death event of

EVENT baptism(INDI);

first baptism event of

EVENT burial(INDI);

first burial event of

INDI father(INDI);

first father of

INDI mother(INDI);

first mother of

INDI nextsib(INDI);

next (younger) sibling of

INDI prevsib(INDI);

previous (older) sibling of

STRING sex(INDI);

sex of

BOOL male(INDI);

male predicate

BOOL female(INDI);

female predicate

STRING pn(INDI, INT);

pronoun referring to

INT nspouses(INDI);

number of spouses of

INT nfamilies(INDI);

number of families (as spouse/parent) of

FAM parents(INDI);

first parents' family of

STRING title(INDI);

first title of

STRING key(INDI|FAM, [BOOL]);

internal key of (work for families also)

STRING soundex(INDI);

SOUNDEX code of

NODE inode(INDI);

root GEDCOM node of

NODE root(INDI);

root GEDCOM node of

INDI indi(STRING);

find person with key value

INDI firstindi(void);

first person in database in key order

INDI lastindi(void);

last person in database in key order

INDI nextindi(INDI);

next person in database in key order

INDI previndi(INDI);

previous person in database in key order

spouses (INDI, INDI, FAM, INT) { commands }

loop through all spouses of

families (INDI, FAM, INDI, INT) { commands }

loop through all families (as spouse) of

forindi (INDI, INT) { commands }

loop through all persons in database

These functions take a person as a parameter and return information about him or her.

Name returns the default name of a person; this is the name found on the first 1 NAME line in the person's record; the slashes are removed and the surname is made all capitals; name can take an optional second parameter - if it is true the function acts as described above; if false, the surname is kept exactly as it is in the record.

Fullname returns the name of a person in a variety of formats. If the second parameter is true the surname is shown in upper case; otherwise the surname is as in the record. If the third parameter is true the parts of the name are shown in the order as found in the record; otherwise the surname is given first, followed by a comma, followed by the other name parts. The fourth parameter specifies the maximum length field that can be used to show the name; various conversions occur if it is necessary to shorten the name to fit this length.

Surname returns the surname of the person, as found in the first 1 NAME line; the slashes are removed. Givens returns the given names of the person in the same order and format as found in the first 1 NAME line of the record. Trimname returns the default name of the person trimmed to the maximum character length given in the second variable.

Birth, death, baptism and burial return the first birth, death, baptism and burial event in the person's record, respectively. An event is a level 1 GEDCOM node. If there is no matching event these functions return null.

Father, mother, nextsib and prevsib return the father, mother, next younger sibling and next older sibling of the person, respectively. If the person has more than one father (mother) the father (mother) function returns the first one. These functions return null if there is no person in the role.

Sex returns the person's sex as the string M if the person is male, F if the person is female, or U if the sex of the person is not known. Male and female return true if the person is male or female, respectively, or false if not.

Pn generates pronouns, useful when generating English text; the second parameter selects the type of pronoun:

0

He/She

1

he/she

2

His/Her

3

his/her

4

him/her

Nspouses returns the number of spouses the person has in the database, and nfamilies returns the number of families the person is a parent/spouse in; these two values are not necessarily the same. Parents returns the first family that the person is a child in.

Title returns the value of the first 1 TITL line in the record. Key returns the key value of a person or family; it there is a second parameter and it is non-null, the leading I or F will be stripped. Soundex returns the Soundex code of the person.

Root and Inode return the root node of the person's GEDCOM node tree. Note that an INDI value is not a NODE value. If you want to process the nodes within a person node tree, you must first use the root or inode function to get the root of the person node tree. Root and inode are synonyms.

Indi returns the person who's key is passed as an argument; if no person has the key indi returns null.

Firstindi, nextindi and previndi allow you to iterate through all persons in the database. Firstindi returns the first person in the database in key order. Nextindi returns the next person after the argument person in key order. Previndi returns the previous person before the argument person in key order.

Spouses is an iterator that loops through each spouse a person has. The first argument is a person. The second argument is a person variable that iterates through the first person's spouses. The third argument is a family variable that iterates through the families the person and each spouse are in. The fourth argument is an integer variable that counts the iterations.

Families is an iterator that loops through the families a person was a spouse/parent in. The first argument is a person. The second argument is a family variable that iterates through the families the first person was a spouse/parent in. The third argument iterates through the spouses from the families; if there is no spouse in a particular family, the variable is set to null for that iteration. The fourth argument is an integer variable that counts the iterations.

Forindi is an iterator that loops through every person in the database in ascending key order. Its first parameter is a variable that iterates through the persons; its second parameter is an integer counter variable that counts the persons starting at one.