View Wishlist

Reference 577
Title Sentence Template Functions to Replace Codes
Category General
Description This request is for functions to replace Sentence Template codes so that those expressions support the same syntax as other expressions.

Throughout FH, expressions are composed of plain text, data references, and functions.
The exception is Sentence Templates that use codes such as {individual} and {date} and enclose data refs and functions in curly brackets.
The codes add useful features but are invalid within functions such as =CombineText() or =TextIf() where conditional structures are required.
e.g. {=TextIf( x=y, {date}, "else" )} is invalid but =TextIf( x=y, FactDate(), "else" ) would be allowed and date prefixes such as in and on are automatically produced.
Furthermore, such new functions may be useful in other expressions within Diagrams, Reports, Queries, etc.
Also, the \ escape character would no longer be needed.
This approach would support User Defined Macros (or Custom Functions).

The first list below suggests new functions where the context allows one function to replace several codes.
e.g. =Principal() refers to the principal individual or family couple depending on the type of fact whether in a principal or witness sentence.

  • {individual} {individual/him/her} {individual's} {principal} {couple} {principals}
    =Principal() name of principal individual or names of family couple with parameters for variant options.
  • {spouse/her/him}
    =Spouse() name of principal's spouse with parameters for variant options.
  • {date}
    =FactDate() with parameters for format and prefixes.
  • {age} {age range} {their ages} {their age ranges}
    =FactAge() with parameters for what and how to calculate, e.g. use actual or estimated birth date.
  • {place} {_place} {_place2}
    =FactPlace() with parameters for arranging parts and prefixes.
  • {address}
    =FactAddr() similar to =Place() or combined with =Place() in a composite =Location() function.
  • {role name} {role=___} {role(single)=___} {role(plural)=___} {other=___} {other(single)=___} {other(plural)=___}
    =Role() with parameters for options and role names.
  • {blank} <br> <para>
    =Format() with parameters for layout options such as "\n\n" or "\t" or maybe fonts. Alternatively, simply allow new line and tab characters in plain text as in long text fields such as Notes.
The existing function =FactText() may also be useful in this context but needs better options for date and place prefixes.

This second list illustrates how other codes can be replaced by existing functions and data references.

  • {him/her} {his/her}
    =Sex(%CUR_PRIN%,"him","her","them") =Sex(%CUR~WITN>%,"his","her","their")
  • {cause} {note}
    %FACT.CAUS% %FACT.NOTE2% %FACT.TYPE% %FACT.PHON% etc.
  • {label} {abbr}
    =FactLabel() =FactAbbr()
  • {value} {a/an value}
    =FactValue() existing function but with new parameters for options and prefixes, or simply use %FACT%.
  • {children} {spouses}
    =TextIf(FactValue()="1","child","children") =TextIf(TextToNumber(%FACT%)<=1,"spouse","spouses")
  • < ... >
    =CombineText() avoids the confusion users experience when more than one variable text is inside < angle > brackets.
Web Link https://www.fhug.org.uk/forum/viewtopic.php?f=43&t=19409
Votes 12
Rating 4.0
Added Wednesday 19th May 2021
Last Vote Sunday 4th June 2023

 

Only Signed in FHUG users can vote, please go to the Forum and sign in.

 Return to List

Request new Wishes