Template Keywords and Functions


The following template keywords can be used in auto-text templates. Some of them can also be used in title templates (see Options screen), Associated Individual Type templates and source templates.

 

When a template is processed these keywords are replaced with the values selected or entered for the entry.

 

{YEAR}: The year that the event took place, e.g. 1891

{COUNTRY}: For census sources only, this is replaced with the census country. e.g. UK

{DATE}: The date that the event being recorded took place. e.g. 3 Sep 1800. There are also various sub-tags available for the DATE keyword (all of the examples below are based on the date 3rd September 1800):

{DATE.DAY}: The day part of the date, e.g. 3

{DATE.DAY2}: The day part of the date as 2 digits, e.g. 03

{DATE.DAY.ORD}: The day part of the date followed by the correct english ordinal (st, nd, rd, th). e.g. 3rd

{DATE.MONTH.NUM}: The month part of the date in numeric format, e.g. 9

{DATE.MONTH.NUM2}: The month part of the date in numeric format (2 digits), e.g. 09

{DATE.MONTH.SHORT}: The month part of the date in short format, e.g. Sep

{DATE.MONTH.SHORT.CAPS}: The month part of the date in short format and capitals, e.g. SEP

{DATE.MONTH.FULL}: The month part of the date in full format, e.g. September

{DATE.MONTH.FULL.CAPS}: The month part of the date in full format and capitals, e.g. SEPTEMBER

{DATE.YEAR}: The year part of the date, e.g. 1800

{DATE.GEDCOMFORMAT}: The date will be formatted in standard GEDCOM format (e.g. 03 SEP 1800). This subtag is particularly required if using the {SYSTEM.DATE} within a source template text field.

{PLACE}: The place where the event took place. e.g. Warrington, Lancashire, England. There are three sub-tags:

{PLACE.SHORT}: The first part of the place up to the first comma, e.g. Warrington

{PLACE.MEDIUM}: The first part of the place up to the second comma, e.g. Warrington, Lancashire

{PLACE.FULL}: This is only required if you are using the Autotext Place/Address Tidy option. The FULL option will return the untidied version of the data.

{ADDR}: The address where the event took place. e.g. Flat 3, The Rectory, Main Street,. There are two sub-tags:

{ADDR.SHORT}: The first part of the address up to the first comma, e.g. Flat 3

{ADDR.MEDIUM}: The first part of the address up to the second comma, e.g. Flat 3, The Rectory

{ADDR.FULL}: This is only required if you are using the Autotext Place/Address Tidy option. The FULL option will return the untidied version of the data.

{OTHER}: The data entered into the 'other information' field.

{REF}: The data entered into the 'Ref ID' field

{INDEX}: The data entered into the 'Index' field

{SOURCESUBTYPE}: This displays the value selected in the source subtype drop-down list that can optionally be displayed for each source type other than census.

{DATEREGISTERED}: For death, marriage and birth records this displays the date that the event was registered. All of the sub-tags that are available for the {DATE} tag are also available for {DATEREGISTERED}

{KEYPERSON}: This displays the name of the 'key person' in this source. i.e. the first name in the census entry (or the selected Key Person), the person being baptised, etc. e.g. Alice Jane Smith.

{SPOUSE}: Only available for marriage templates, this displays the name of the person marrying the  'key person' in this source. 

{KEYFATHER}: Only available for non-census autotext templates, this displays details of the father of the 'key person'.

{KEYMOTHER}: Only available for non-census autotext templates, this displays details of the mother of the 'key person'.

{SPOUSEFATHER}: Only available for marriage templates, this displays details of the father of the 'spouse'.

{SPOUSEMOTHER}: Only available for marriage templates, this displays details of the mother of the 'spouse'.

{INFORMANT}: Only available for birth and death templates, this displays details about the informant (the person who reported the birth or death).

{ASSOCPERSON}: Only available for Associated Individual Type templates, this displays details of the associated individual.

{IMAGEINFO}: Only available for image title templates. When adding a new image using the Image Viewer screen, text in the Additional Information box will replace the {IMAGEINFO} tag.

 

There are various sub-tags available for the KEYPERSON, SPOUSE, KEYMOTHER, KEYFATHER, SPOUSEFATHER, SPOUSEMOTHER, PERSON and ASSOCPERSON keywords that can be used to alter the format in which the information is displayed in the title. The examples below show KEYPERSON but would also apply for the others:

 

{KEYPERSON.SN_GN}: Displays the surname first, followed by the given name(s), e.g. Smith, Alice Jane

{KEYPERSON.SN_GN.CAPS}: Displays the surname first in capitals, followed by the given name(s), e.g. SMITH, Alice Jane

{KEYPERSON.FULL}: Displays the full name of the individual (identical behaviour to the KEYPERSON tag without sub-tags), e.g. Alice Jane Smith

{KEYPERSON.FULL.CAPS}: Displays the full name of the individual with surname in capitals, e.g. Alice Jane SMITH

 

There are further sub-tags which can display part of the name of the individual and are included to allow further flexibility for users who prefer to specify their own formats.

 

{KEYPERSON.SN}: Displays the surname of the individual, e.g. Smith

{KEYPERSON.SN.CAPS}: Displays the surname of the individual in capitals, e.g. SMITH

{KEYPERSON.SN_ORIGINAL}: Displays the surname of the individual as recorded in the family history file, e.g. Smith. This can be used where the maiden name of a woman needs to be displayed on a death or burial record and the Use last married name for deceased female option is selected. SN_ORIGINAL returns the same result as SN if the Use last married name option is not being used.

{KEYPERSON.SN_ORIGINAL.CAPS}: Displays the surname of the individual as recorded in the family history file, in capitals , e.g. SMITH. This can be used where the maiden name of a woman needs to be displayed on a death or burial record and the Use last married name for deceased female option is selected. SN_ORIGINAL.CAPS returns the same result as SN.CAPS if the Use last married name option is not being used.

{KEYPERSON.GN}: Displays the given names of the individual, e.g. Alice Jane

{KEYPERSON.GN.CAPS}: Displays the given names of the individual in capitals, e.g. ALICE JANE

{KEYPERSON.GN_INIT}: Displays the given names of the individual with all names other than the first displayed as initials, e.g. Alice J

{KEYPERSON.GN_INIT.CAPS}: Displays in capitals the given names of the individual with all names other than the first displayed as initials, e.g. ALICE J

{KEYPERSON.GN_INIT.PERIODS}: Displays in capitals the given names of the individual with all names other than the first displayed as initials with periods/full-stops, e.g. Alice J.

{KEYPERSON.GN_INIT.CAPSPERIODS}: Displays in capitals the given names of the individual with all names other than the first displayed as initials with periods/full-stops, e.g. ALICE J.

{KEYPERSON.INIT}: Displays the given name initials of the individual, e.g. A J

{KEYPERSON.INIT.PERIODS}: Displays the given name initials of the individual with periods/full-stops, e.g. A. J.

 

These sub-tags can be combined, e.g. {KEYPERSON.INIT.PERIODS} {KEYPERSON.SN.CAPS} in the template would be replaced by: A. J. SMITH

 

{KEYPERSON.ID}:  This can be used to display the ID of the individual. However, this will not be able to display the ID if an individual is entered directly into the main screen for baptism or birth source types as the ID is not generated until the record is saved. Therefore the special characters @INDM1@, @INDFT@ and @INDMT@ will be inserted into the text as 'place-holders' for the individual, father and mother IDs. When the entry is saved the IDs will be generated and will automatically replace those IDs.

{KEYPERSON.CUSTOMID}:  If the option to use Custom IDs is selected then this will display the custom ID for the individual. It will be blank if there is no Custom ID.

{KEYPERSON.AGE.SHORT}: Displays the age entered for the individual in short format. eg. 3y 2m

{KEYPERSON.AGE.LONG}: Displays the age entered for the individual in long format. eg. 3 yrs 2 mths

{KEYPERSON.RELATION}: Available only for census entries, if there is a Relationship column this displays the relationship recorded.

 

The following sub-tags only apply to non-census Auto-text templates and some may not be available depending on the source document type:

 

{KEYPERSON.GENDER}: Displays gender of the individual using the words male or female

{KEYPERSON.GENDER.HISHER}: Displays gender of the individual using the words his or her

{KEYPERSON.GENDER.FATHERMOTHER}: Displays gender of the individual using the words father or mother

{KEYPERSON.GENDER.SONDAUGHTER}: Displays gender of the individual using the words son or daughter     

{KEYPERSON.GENDER.BOYGIRL}: Displays gender of the individual using the words boy or girl

{KEYPERSON.GENDER.HUSBANDWIFE}: Displays gender of the individual using the words husband or wife

{KEYPERSON.GENDER.WIDOWERWIDOW}: Displays gender of the individual using the words widower or widow

{KEYPERSON.OCCUPATION}: Displays the occupation entered for the individual

{KEYPERSON.BIRTHDATE}: Displays the date of birth entered for the individual. All of the sub-tags that are available for the {DATE} tag are also available.

{KEYPERSON.BIRTHPLACE.PLACE}: Displays the place of birth entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.SHORT above)

{KEYPERSON.BIRTHPLACE.ADDRESS}: Displays the address for birthplace entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.ADDRESS above)

{KEYPERSON.DEATHDATE}: Displays the date of death entered for the individual. All of the sub-tags that are available for the {DATE} tag are also available.

{KEYPERSON.DEATHPLACE.PLACE}: Displays the place of death entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.SHORT above)

{KEYPERSON.DEATHPLACE.ADDRESS}: Displays the address for the place of death entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.ADDRESS above)

{KEYPERSON.RESIDENCE.PLACE}: Displays the place of residence entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.SHORT above)

{KEYPERSON.RESIDENCE.ADDRESS}: Displays the address of residence entered for the individual. The SHORT, MEDIUM and FULL keywords can also be used (see PLACE.ADDRESS above)

{KEYPERSON.MARITALSTATUS}: Displays the marital status entered for the individual, if a marriage, burial or death entry

{KEYPERSON.RELIGION}: Displays the religion entered for the individual, if a marriage, burial or death entry

{KEYPERSON.DECEASED}: Displays the word (Deceased) if the individual has been marked as deceased. This can be used only with parents in baptism, burial, death or marriage records. 

{KEYPERSON.CAUSEOFDEATH}:Displays the cause of death entered for an individual, if a death, burial or cremation.

{KEYPERSON.DEATHCERTIFIED}: Displays the details of the certification of death entered for an individual, if a death, burial or cremation.

{INFORMANT.DESCRIPTION}: The description given of the informant of a death or birth (e.g. wife of deceased, neighbour of deceased)

{INFORMANT.IDENTITY}: For a birth this returns the identity of the informant. The values returned by this keyword are either NONE, FATHER, MOTHER or OTHER.

{INFORMANT.INFORMATION}: For death informants this displays the Death Informant Information if selected from the drop-down list.

{MINISTER}: For parish records this displays the minister entered (e.g priest or vicar).

{REGISTRAR}: For death records this displays the registrar's details if entered.

{ASSOCLIST.COMMA}: Shows a list of all associated individuals separated by commas. This is the default if the {ASSOCLIST} is used on its own without a sub-tag.

{ASSOCLIST.COMMA.AND}: Shows a list of all associated individuals separated by commas but with the word 'and' before the last individual rather than a comma.

{ASSOCLIST.COMMACR}: Shows a list of all associated individuals separated by commas and carriage returns

 

ASSOCLIST can also include a parameter in square brackets to specify that a particular witness type should be displayed. For example: {ASSOCLIST[Witnesses].COMMA} would show just associated individuals where the title of the association type is 'Witnesses'.

 

{SOURCETYPE}: If a census record then this will display 'Census'. If a baptism then it will display the word Baptism or Christening (if the use christening fact instead option is selected on the Options screen).

{MARRIAGETYPE}: If a marriage record then this displays the marriage type entered (e.g. By Banns or By Licence)

{COLUMNCOUNT}: For census sources, this returns the number of columns in the current census entry.

{PERSONCOUNT}: For census and monumental inscription sources, this returns the number of individuals added to the entry.

{PERSON[*]}: For monumental inscription sources this can be used to return the information about one of the individuals added to the entry. The first individual would be referred to as {PERSON[1]}, the second as {PERSON[2]}, etc. It is used with one of a number of different sub-tags, most of which are listed under the {KEYPERSON} entry above, in order to access the various items of information that can entered about each individual in an MI source. For example, {PERSON[1].DEATHDATE} would display the date of death for the first individual. An additional sub-tag {PERSON[*].BURIALCREMATION} is available that returns the word 'burial' or 'cremation' depending on the value selected for the individual. {PERSON} is usually used in conjunction with the =LOOP function to iterate through each of the specified individuals.

{CELL[column%row]}: For census sources, CELL can be used together with one of the sub-tags listed below to return information from a given column and row.

 {CELL[%].HEADING.SHORT}: For the given column, this displays the short version of the column heading. The row parameter is ignored.

 {CELL[%].HEADING.LONG}: For the given column, this displays the long version of the column heading. The row parameter is ignored.

{CELL[%].TYPE}: For the given column, this returns the type of column. The possible values are: , cAge, cAgeNextBirthday, cAgeRounded, cBirthDate, cGender, cGeneric, cMarriageCondition, cName, cNationality, cOccupation, cPhysicalDescription, cPlaceOfBirth, cRelationship, cReligion. The row parameter is ignored.

 {CELL[%].VALUE}: This returns the value of the census cell as specified by the column and row.

 {CELL[%].WIDTH}: For the given column, this returns the width. The row parameter is ignored.

 

{STEMPLATE[*]}: This can be used to display the value of a Source Template field, for those who use Family Historian templated sources rather than generic sources. The value in the brackets specifies the index of the field to be displayed. For example {STEMPLATE[3]} would display the value of the 3rd field. There are a large number of sub-tags available, depending on the type of source template field and their usage matches the descriptions above.

 Date fields can use the {DATE} sub-tags described above. For example: {STEMPLATE[2].MONTH.FULL}

 Place and Address fields can use the SHORT/MEDIUM/FULL sub-tags described above. For example: {STEMPLATE[10].MEDIUM}

 Name fields can use the name-related KeyPerson sub-tags described above. For example: {STEMPLATE[3].SN_GN.CAPS}

 

{CENSUSGRID}: This only applies to census autotext templates and is used to display the text from the census grid, with columns separated by comma, tab or other characters as specified in the Options screen.

{SYSTEM.VERSION}: This displays the current version of Ancestral Sources, e.g. 3.0.0

{SYSTEM.DATE}: This displays today's date. All of the date sub tags described earlier on this page can also be used. If you are using this within a source template date field that you should use the {SYSTEM.DATE.GEDCOMFORMAT} variant to ensure it is recorded in the correct format. 

{SYSTEM.TRANSCRIBER}: This displays the name of the transcriber as specified on the General tab of the Options screen. You could for example use the SYSTEM keywords together on your templates: Transcribed by {SYSTEM.TRANSCRIBER} on {SYSTEM.DATE} using Ancestral Sources v{SYSTEM.VERSION}.

{SYSTEM.EXTENDEDBIRTHSUPPORT}: This displays TRUE if the extended birth support is enabled (to allow entry of birth details for parents in baptism, marriage, burial and death entries and also spouses in burial and death entries).

{REPOSITORY}: Displays information about the selected Repository depending on the sub-tag used.

 {REPOSITORY.NAME}: Displays repository name

 {REPOSITORY.ID}: Displays repository ID

 {REPOSITORY.ADDRESS}: Displays repository address

 {REPOSITORY.TELEPHONE}: Displays repository telephone number

 {REPOSITORY.EMAIL}: Displays repository email address

 {REPOSITORY.WEBSITE}: Displays repository website

 {REPOSITORY.CUSTOMID}: Displays repository custom id

{//}:  This can be used in auto-text templates to start a section of annotation or comment into the code. All of the text following this on the same line is ignored. The carriage return at the end of the line is ignored and therefore the {//} can be useful just for breaking up very long lines of text. Multi-line annotation requires the {//} to be used before each line of the annotation.

 

Note that if you need to use the left curly-bracket symbol { within your text you will need to type it twice {{ to inform Ancestral Sources that you are not starting a keyword but actually want to insert the curly-bracket.

 

Functions

 

Functions can be used in auto-text templates. Each of the functions are explained below. Note that in versions of Ancestral Sources prior to v7, the separator/deliminator in functions was the | character. This was changed to be a % character to avoid clashing with the | character that is used in Family Historian rich text.

 

=IF[Reference%Output1%Output2]

 

The =IF function takes 3 parameters. If the first parameter evaluates to a non-empty string of characters then the second parameter is displayed otherwise the third parameter is displayed.

 

e.g. =IF[{KEYPERSON.BIRTHPLACE.PLACE}%{KEYPERSON.BIRTHPLACE.PLACE}%Not Recorded]

 

In this example, if a birthplace has been recorded then it is displayed, otherwise the words 'Not Recorded' will be shown.

 

Functions can also be 'nested', e..g =IF statements can appear within other =IF statements. This can lead to some very flexible templates being created but they can also become quite complex.

 

=EQUALS[value1%value2]

 

The =EQUALS function takes two parameters. If they are the same then the value TRUE is returned from the function, if they are different then no value is returned, e.g. =EQUALS[ABC%XYZ] would return no value. In making the comparison between the two values the case is significant, e.g. =EQUALS[ABC%abc] would return no value. You could combine this function with the =LOWER or =UPPER functions if you wanted to ignore the case.

 

The =EQUALSNOT function described in the next section is identical to the =EQUALS function but returns TRUE if the two values are different.

 

The =EQUALS function is designed to be used with the =IF function.

 

e.g. =IF[=EQUALS[{KEYPERSON.GENDER}%male]%M%F]

 

This would return either M or F depending on the gender of the individual. This looks at the GENDER value of the keyperson and compares this to the word 'male'. If TRUE is returned then the output will be M, otherwise it will be F.

 

Actually this example wouldn't work if the gender of the individual wasn't set so a more correct example would require a nested =IF function and two =EQUALS:

 

=IF[=EQUALS[{KEYPERSON.GENDER}%male]%M%=IF[=EQUALS[{KEYPERSON.GENDER}%female]%F%-]]

 

=EQUALSNOT[value1%value2]

 

The =EQUALSNOT function takes two parameters. If they are different then the value TRUE is returned from the function, if they are the same then no value is returned, e.g. =EQUALSNOT[ABC%XYZ] would return TRUE. In making the comparison between the two values the case is significant, e.g. =EQUALSNOT[ABC%abc] would return TRUE. lue. You could combine this function with the =LOWER or =UPPER functions if you wanted to ignore the case. This function serves the same purpose as the =EQUALS function described above, which returns TRUE if the two values are the same.

 

=AND[value1%value2]

 

The =AND function takes two parameters. If both values are not empty then the function returns TRUE, otherwise it returns nothing. e.g. =AND[ABC%XYZ] would return TRUE but =AND[ABC%] would return an empty string. The =AND function is designed to be used with the =IF function.

 

=OR[value1%value2]

 

The =OR function takes two parameters. If either value is not empty then the function returns TRUE, otherwise it returns nothing. e.g. =OR[ABC%XYZ] would return TRUE, as would =OR[ABC%], but =OR[%] would return an empty string. The =OR function is designed to be used with the =IF function.

 

=NOT[value]

 

The =NOT function takes one parameter. If the parameter is an empty string then it returns TRUE, otherwise it returns nothing. The =NOT function is designed to be used with the =IF function.

 

=UPPER[value]

 

The =UPPER function takes one parameter and converts the value into upper case.

 

e.g. =UPPER[{KEYPERSON.BIRTHPLACE.PLACE}]

 

might return WARRINGTON, LANCASHIRE

 

=LOWER[value]

 

The =LOWER function takes one parameter and converts the value into lower case.

 

e.g. =LOWER[{KEYPERSON.BIRTHPLACE.PLACE}]

 

might return warrington, lancashire

 

=TITLE[value]

 

The =TITLE function takes one parameter and converts the value into title case, i.e. capitalises the first letter of each word and leaves the others in lower case.

 

e.g. =TITLE[{KEYPERSON.BIRTHPLACE.PLACE}]

 

might return Warrington, Lancashire

 

=TITLEF[value]

 

The =TITLEF function takes one parameter and converts the first character to upper case

 

e.g. =TITLEF[{KEYPERSON.BIRTHPLACE.PLACE}]

 

might return Warrington, lancashire

 

=TRIM[value]

 

The =TRIM function removes any spaces from the start and the end of a string of characters. 

 

e.g. =TRIM[  Smith  ]

 

Would take the 9 characters in the parameter "  Smith  " and return just the 5 characters "Smith"

 

=LTRIM[value]

 

The =LTRIM function removes any spaces from the start (left) of a string of characters. 

 

e.g. =LTRIM[  Smith  ]

 

Would take the 9 characters in the parameter "  Smith  ", remove the spaces at the start of the string, and return just the 7 characters "Smith  " (i.e. the two spaces on the right of the string would remain)

 

=RTRIM[value]

 

The =RTRIM function removes any spaces from the end (right) of a string. 

 

e.g. =RTRIM[  Smith  ]

 

Would take the 7 characters in the parameter "  Smith  ", remove the spaces at the end of the string, and return just the 7 characters "  Smith" (i.e. the two spaces on the left of the string would remain)

 

 

=CONTAINS[text%sub-text]

 

The =CONTAINS function returns TRUE if the value of the first parameter contains the value of the second parameter, otherwise it returns nothing. The comparison is case sensitive so you could combine with the =LOWER function if you want to ignore case. The =CONTAINS function is designed to be used with the =IF function.

 

e.g. =IF[=CONTAINS[{PLACE}%Cheshire]%County of Cheshire%{PLACE}]

 

=STARTSWITH[text%sub-text]

 

The =STARTSWITH function returns TRUE if the value of the first parameter starts with the value of the second parameter, otherwise it returns nothing. The comparison is case sensitive so you could combine with the =LOWER function if you want to ignore case. The =STARTSWITH function is designed to be used with the =IF function.

 

e.g. =IF[=STARTSWITH[{YEAR}%19]%20th Century%Not 20th Century]

 

=ENDSWITH[text%sub-text]

 

The =ENDSWITH function returns TRUE if the value of the first parameter ends with the value of the second parameter, otherwise it returns nothing. The comparison is case sensitive so you could combine with the =LOWER function if you want to ignore case. The =ENDSWITH function is designed to be used with the =IF function.

 

e.g. =IF[=ENDSWITH[{PLACE}%USA]%United States%]

 

=ADD[numeric%numeric]

 

The ADD function will add together two numeric values. If either of the values is not a number it will return nothing. 

 

e.g. =ADD[{YEAR}%5]

 

=SUB[numeric%numeric]

 

The SUB function will subtract a numeric value (second parameter) from another numeric value (first parameter). If either of the values is not a number it will return nothing.

 

e.g. =SUB[{YEAR}%5]

 

=MULT[numeric%numeric]

 

The MULT function will multiply together two numeric values. If either of the values is not a number it will return nothing. 

 

e.g. =MULT[{RTF-WIDTH1}%2]

 

=DIV[numeric%numeric]

 

The DIV function will divide a numeric value (first parameter) by another numeric value (second parameter) using integer division.  If either of the values is not a number, or the second parameter is 0, it will return nothing.

 

e.g. =DIV[{RTF-WIDTH5}%2]

 

=WORDNUM[numeric%mode]

 

The WORDNUM function can be used to convert a number (between 1 and 9999) into an english version of it. The mode is a number between 1 and 6 that specifies how the returned value is displayed. It may also be useful to combine with the TITLE or TITLEF functions.

 

e.g. =TITLEF[=WORDNUM[{YEAR}%2]]

 

In the example, if the year was 1853 then the values returned would be as follows, depending on the mode:

 

Mode 1:  Eighteen hundred and fifty-three

Mode 2: Eighteen hundred and fifty three (Same as Mode 1 without hyphens)

Mode 3:  Eighteen fifty-three

Mode 4: Eighteen fifty three (Same as Mode 3 without hyphens)

Mode 5:  One thousand eight hundred and fifty-three

Mode 6: One thousand eight hundred and fifty three (Same as Mode 5 without hyphens)

 

=WORDNUMORD[numeric%mode]

 

The WORDNUM function can be used to convert a number (between 1 and 9999) into an english ordinal version of it. The mode is a number between 1 and 6 that specifies how the returned value is displayed. It may also be useful to combine with the TITLE or TITLEF functions.

 

e.g. =TITLEF[=WORDNUMORD[{DAY}%2]]

 

Might display first, second, third, fourth, etc.

 

The mode values use the same formats as explained in the previous section describing the WORDNUM function. Modes 3 and 4 are probably not useful with ordinal values but are available to provide consistency with WORDNUM.

 

=COMMAINDEX[index%text]

 

If text includes commas, then the COMMAINDEX function will return one element from the comma separated text as specified by the index. The main purpose of this is that it can be used to select particular elements from a place or address definition. The first element has index 0. If there are no commas then index 0 will return all of the text, any other index will return no text.

 

e.g.  =COMMAINDEX[0%Latchford, Cheshire, England]   would return Latchford

 =COMMAINDEX[1%Latchford, Cheshire, England]   would return Cheshire

 =COMMAINDEX[3%Latchford, Cheshire, England]   would return nothing

 

It is recommended that you use the .FULL sub-tag of a place or address so that it is affected by any commas that may be removed by the Autotext Place/Address Tidy option.

 

=SET[variable%value]

 

This declares and sets an initial value to a variable. A variable can be used to store a value.

 

e.g.  =SET[count%7]

 

Would create a variable called 'count' and sets it value to be 7. See the definition of =GET below for further examples.

 

=GET[variable]

 

=GET returnes the value of the variable specified.

 

e.g.  =ADD[count%1]

 =GET[count]

 

Would increment (add 1) to the 'count' variable and then display the value of 'count'.

 

In the following example, a variable called 'hasPlace' is given the value True if place is recorded.

 

e.g. =IF[{PLACE}%=SET[hasPlace,True]%]

 

=LOOP[variable%numeric%numeric%expression]

 

The first parameter is the name of a variable (known as a loop variable) and this is set to be the value of the 2nd parameter. All of the functions, keywords and text that appears in the 4th expression parameter will be repeated as part of the loop. Each time the loop repeats the value of the loop variable is incremented. The loop completes after the the loop variable has reached the maximum value specified by the 3rd parameter.

 

The following example will display the numbers from 1 to 10 separated by commas. The loop displays 1 to 9 followed by commas and then the 10 is added separately afterwards to avoid having an additional commas.

 

=LOOP[data%1,9%=GET[data], ]10

 

For Monumental Inscription sources =LOOP is used in conjunction with the {PERSON[]} keyword to display each of the individuals referred to in the entry. It can also make use of the {PERSONCOUNT} keyword that indicates the number of people referred to in the MI source. In the following example, the name of each person entered into the MI record is displayed:

 

=LOOP[p%1%{PERSONCOUNT}%{PERSON[=GET[p]].FULL}

]

 

Census sources can also use the {PERSONCOUNT} keyword and the {COLUMNCOUNT} keyword together with =LOOP. The following example uses a loop inside another loop (know as a 'nested loop') together with the {CELL[%]} keyword to display the value of each cell. The outer loop iterates through each individual while the inner loop iterates through the columns:

 

 =LOOP[p%1%{PERSONCOUNT}%=LOOP[c%1%{COLUMNCOUNT}%{CELL[=GET[c]%=GET[p]].VALUE}, ]

]

 

 

Rich Text Keywords and Functions

 

In rich text templates, if the Hyper-link to individual records option is set then the =LINKIND function can be used to specify where the hyper-links will appear and the individuals they will link to.

 

=LINKIND[id%value]

The value text will become a hyperlink to the individual with the specified id.

 

e.g. =LINKIND[{KEYPERSON.ID}%{KEYPERSON.FULL}]

 

would create a hyperlink to the key person using their full name as the link text. It is also possible to use the =UPPER[], =LOWER[], =TITLE[] and =TITLEF[] functions (described earlier on this page) around a LINKIND function to display the individual's name in upper case, lower case, etc. 

 

e.g. =UPPER[=LINKIND[{KEYPERSON.ID}%{KEYPERSON.FULL}]]

 

When entering rich text you can use FTF (Family Historian Text Format) as described in the Family Historian Plugin Help file. There are also some special style tags available.

 

{RTF-TITLE}: This tag can be used to specify the start of text that should be given the title style. The title style can be defined on the Source Text Options screen. This definition can specify the font, font size, colour and style (bold, italics, underline). To turn off this style use the {RTF-TITLE.OFF} tag.

 

{RTF-HEAD}: This tag can be used to specify the start of text that should be given the heading style. The title style can be defined on the Source Text Options screen. This definition can specify the font, font size, colour and style (bold, italics, underline). To turn off this style use the {RTF-HEAD.OFF} tag.

 

{RTF-NORMAL}: This tag can be used to specify the start of text that should be given the normal style. The title style can be defined on the Source Text Options screen. This definition can specify the font, font size, colour and style (bold, italics, underline). To turn off this style use the {RTF-NORMAL.OFF} tag.

 

{RTF-WIDTH1} to {RTF-WIDTH10}: These tags can be used to specify column widths in rich text auto-text templates. These widths can be controlled on the Source Text Options screen. Some of the standard templates use these widths for table columns and if you need to make them wider or narrower change then change them on the options screen rather than editing the template.

 

You could also combine these widths using the =ADD or =MULT functions. e.g. =MULT[{RTF-WIDTH10}%2] would produce a width that is twice that of WIDTH10.

 

 

Family Historian Richtext (FTF) Style and Formatting Syntax

 

The Family Historian help guide includes details of other formatting keywords that can be used in rich-text. This is referred to as FTF (Family Historian Text Format).

bold 

on = <b>; off = </b>; example: An <b>important</b> point. 

italics 

on = <i>; off = </i>; example: An <i>important</i> point. 

underline 

on = <u>; off = </u>; example: An <u>important</u> point. 

strikeout 

on = <s>; off = </s>; example: An <s>important</s> point. 

font size 

Font sizes are specified relative to the default font size. Use <fs=(param)> to set a font size. Use </fs> to revert to the default font size. The fs command takes a single parameter, which is the point size change - e.g. "+3.5" or "-2". Use a positive value to make fonts larger and a negative value to make fonts smaller. Example: An <fs="+1">important</fs> point. Font sizes are not additive. They don't accumulate. For example: <fs="+3.5">this is big, but <fs="+3.5">this is no bigger</fs> 

font 

Use <font=(params)> to set a non-default font. Use </font> to revert to the default font. The font command takes up to 3 parameters. Only the first is not optional. The parameters are: font name, font style and character set. Supported values for font style are: "nil", "roman", "swiss", "modern", "script", "decor", "tech" and "bidi". If the font style parameter is blank or not supplied, it defaults to "nil". The character set value is numeric - e.g. 0, 1, 2, etc. 0 is the ANSI character set. 1 is the default character set. 2 is the symbol character set. If you don't know which character set value to use, it is usually better not to supply one. The exception is that if you want a symbol character set (e.g. Wingdings), you must supply 2 as the character set. If you want to supply the character set (3rd parameter), but don't know the font style (2nd parameter), you can leave the font style blank, like this: <font="Wingdings",,2>. Other example uses of the font command: An <font="Calibri">important</font> point. Another example: An <font="Calibri","Swiss",0>important</font> point. 

text colour 

Use <clr=(params)> to set a non-default text colour. Use </clr> to revert to the default text colour (black). The clr command takes one parameter which is the colour, specified as a 6-character string, representing the colour in RGB (red, green, blue) format. The first 2 characters represent the red component as a value between 0 and 255, in Hexadecimal format (e.g. FF is 255). The next 2 characters similarly represent the green component, and the last 2 characters represent the blue component. Example: A <clr="FF0000">red</clr> word, a <clr="00FF00">blue</clr> word, and a <clr="0000FF">green</clr> word. 

highlight colour 

The highlight colour is the background colour for text. Use <hl=(params)> to set a non-default background colour for a section of text. Use </hl> to revert to the default background colour (white). The hl command takes one parameter which is the colour, specified as a 6-character string in the same format as used for text colour. Example: <hl="FF0000">red</hl> has a red background, <hl="00FF00">blue</hl> has a blue background, and <hl="0000FF">green</hl> has a green background. 

 

Formatting syntax applies to an entire paragraph - either in the main body of text or within the cell of a table. You can also use indent and alignment formatting syntax with tables (as a whole, this is - i.e. not just within a cell), if you want a table to be indented, centred or right-aligned say. Setting the alignment of a table to 'justified' has no effect however. 

bullet 

Any paragraph that begins with an asterisk (*), optionally followed by a single space. Example: * This paragraph is bulleted. 

indent 

Any paragraph that begins with one or more right angle brackets (>) is indented. The number of right angle brackets indicates the number of indents. Example: >> This paragraph is indented twice. 

alignment 

To apply alignment (left, right, centre or justify) to a paragraph, use the <align=(params)> command at the start of the paragraph. The align command takes one parameter which is the alignment required: l=left-aligned, c=centred, r=right-aligned, j=justified. If you don't specify an alignment, the default is left-justified. Example: <align="r">This paragraph is right-aligned. 

You can combine formatting commands. If you do so, indent must proceed alignment, followed by bullet or table (the last two are mutually exclusive alternatives). For example, >>* This paragraph is indented twice and bulleted .

 

FTF Table Syntax

Tables can have any number of rows and columns. Within FTF syntax, you cannot have a table within a table - i.e. you cannot have a table within a cell (this is, however, permitted within eFTF syntax). This section describes basic FTF syntax for tables only.

table 

Tables can only be inserted at the start of a line (except as specified in FTF Formatting Syntax above). Use the <table=(params)> command to mark the start of a table. Use the </table> command to mark the end of a table, after the last row. You cannot have any more text on the same line after the end of a table. Any further text must be added on a new line. In FTF syntax, only one parameter is supported for the table command. This is a single string which specifies both the number of columns and their widths in twips. A twip is one-twentieth of a point (the size that fonts are specified in). For a table with just one column, the string just gives the column width in twips. For a table with more than one column, specify the width of each column in order, separated by a vertical bar. For example, <table="400|800|300"> specifies a table with 3 columns, of width 400, 800 and 300 twips, respectively. You can omit the column widths if you wish, in which case a default size of 800 twips will be used. For example, <table="|"> specifies a table with 2 columns (one separator implies two columns), each of which has a default width of 800 twips. 

row 

Within a table, the start of a row is marked by the <row> command (with no parameters) and its end is marked by the </row> command. 

cell 

Cells are located within rows. There is no command to mark the beginning or end of a cell. A vertical bar (|) is used to separate one cell from another. As mentioned above, if you want to include a vertical bar as part of the text within a cell, you must put an escape character (a backslash) before it. 

To make the text easier to read, you can optionally include a single space character before or after the cell separator character (the vertical bar). You can also optionally include a single space after the <row> command or before the </row> command. These single character spaces will be ignored (as long they don't compound - if a cell is empty, at most one space character will be ignored). This means that if you want a cell to begin or end with a space character, you must add an extra one, to allow for the space character that will be ignored.

This is an example of a table that contains 2 rows and 3 columns. The first row has the words 'apple', 'pear' and 'orange' in the 3 cells of the first row, and the words 'house', 'tree' and 'car' in the 3 cells of the second row. None of the cells contain any spaces. The table is preceded by the sentence: "This comes before the table." and is followed, on a new line, by the sentence "this comes after the table."

This comes before the table.

<table="800|800|800">

<row> apple | pear | orange </row>

<row> house| tree | car </row>

</table>

This comes after the table.