LifeLines Programmers Reference

Version 3.0.2

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines


Person Functions

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

FunctionDescription
string name(indi [,bool]) 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.
string fullname(indi, bool, bool, int) 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.
string surname(indi) Surname returns the surname of the person, as found in the first 1 NAME line; the slashes are removed.
string givens(indi) 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.
string trimname(indi,int) Trimname returns the default name of the person trimmed to the maximum character length given in the second variable.
event birth(indi) 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. Birth returns the first birth (BIRT tag) event in the person's record.
event death(indi) Death returns the first death (DEAT tag) event in the person's record.
event baptism(indi) Baptism returns the first baptism (CHR tag) event in the person's record.
event burial(indi) Burial returns the first burial event (BURI tag) in the person's record.
indi father(indi) Father, mother, nextsib and prevsib return the father, mother, next younger sibling and next older sibling of the person, respectively. These functions return null if there is no person in the role. Father returns the father of the person. If the person has more than one father the function returns the first one.
indi mother(indi) Mother returns the mother of the person. If the person has more than one mother the function returns the first one.
indi nextsib(indi) Nextsib returns the next younger sibling of the person.
indi prevsib(indi) Prevsib returns the next older sibling of the person.
string sex(indi) 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.
bool male(indi) Male returns true if the person is male or false if not.
bool female(indi) Female returns true if the person is female or false if not.
string pn(indi, int) Pn returns 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
int nspouses(indi) Nspouses returns the number of spouses the person has in the database. This is not necessarily the same number returned by nfamilies.
int nfamilies(indi) Nfamilies returns the number of families the person is a parent/spouse in. This is not necessarily the same number returned by nspouses.
fam parents(indi) Parents returns the first family that the person is a child in.
string title(indi) Title returns the value of the first 1 TITL line in the record.
string key(indi|fam [,bool]) Key returns the key value of a person or family; if there is a second parameter and it is true, the leading I or F will be stripped.
string soundex(indi)Soundex returns the Soundex code of the person.
node inode(indi) Inode and root 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 record, you must first use the root or inode function to retrieve the root node of the person's GEDCOM node tree.
node root(indi) Root does the same function as inode; root also retuns the root node of family records.
indi indi(string) Indi returns the person who's key is passed as an argument; if no person has the key, indi returns null.
indi firstindi() 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.
indi nextindi(indi) Nextindi returns the person after the argument person in key order.
indi previndi(indi) Previndi returns the person before the argument person in key order.
spouses (indi, indi_v, fam_v, int_v) { } 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 (indi, fam_v, indi_v, int_v) { } Families is an iterator that loops through the families a person is 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 is a spouse/parent in. The third argument is a person variable that iterates through the spouses of 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 (indi_v, int_v) { } 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.

up | previous | next | Tom Wetmore | ttw@shore.net | LifeLines

1/1/00