GEDCOM Expressions

You can use GEDCOM expressions, which are text phrases beginning in "@", to extract text from the current genealogy data. Furthermore, the result of a GEDCOM expression can be used as an element in any expression.

Note that these "@" expressions are for use when customizing the interface by writing browser styles. When writing internal scripts, the "@" expression changes from reading genealogy data to reading properties of scripting objects.

GEDCOM Expressions

A GEDCOM expression begins with an "@" sign and has any number of GEDCOM tags or specially defined psuedo tags connected by periods:

@tag1.tag2.tag3. ...

GEDCOM expressions are evaluated left to right by looking up the tags in the GEDCOM data or by performing special tag functions. When in a template, the look up starts in the GEDCOM structure for the current template. The following rules apply:

Notes

  1. Even though a @_REF expression looks like a reference to a GEDCOM tag (and can even be indexed), it does not correspond to actual GEDCOM data. Thus you cannot use Show _REF or ShowAll _REF commands to access the cited records or read all cited records in ReadAll or RepeatWith commands. You could however, read all cited records in a repeat loop such as:
    #index=0
    Repeat
      #index+=1
      #cite=@_REF.i.#index
      if #cite=""
        break
      endif
      
      ! commands to display cited record with pointer in #cite
      
    EndRepeat
    
    Warning: Some GEDCOM files cite source records by many records (maybe thousands of records in large files). A template to display them all could get intolerably slow. A simple solution is for the template to use a LinkButton MenuLinked to the "Referenced By" menu command.
  2. This tag must be the last tag in an expression. Any tags after this tag will be ignored.
  3. If the date referenced by the expression is not in the file, the result of the expression will be an empty string.