GENerel Language Reference
GEDitCOM II has a built-in interpretive language called GENerel for programmatically setting up the user interface and also for writing Internal Scripts. This section describes the syntax of the language and all generic commands for language control. The GENerel Commands section describes extra commands for displaying genealogy data in the user interface. The Scripting Commands section describes extra commands when writing Internal Scripts
- Command Line Syntax
- Variable Names and Variable Arrays
- Scripting Objects - for Internal Scripts only
- Expression Syntax
- GEDCOM Expression Syntax - an expression to access GEDCOM data.
These additional topics describe language control features:
Conditional Commands
Conditional blocks control what commands are executed depending on conditions of checked variables.
- If ... Else ... EndIf: Numeric conditional command.
- IfStr ... Else ... EndIf: String conditional command.
Repeat Commands
Repeat commands provide looping for repetitive tasks.
- Repeat ... EndRepeat: Define a repeat loop.
- RepeatWith ... EndRepeat: Define a repeat loop that iterates through a list of strings or objects.
- Break: Break out of a repeat loop.
- BreakAll: Break out of all repeat loops.
- Continue: Continue the current repeat loop.
Subroutine and Definition Commands
Subroutines can be defined at the start of the commands and called with optional parameters.
- Sub ... EndSub: Define a subroutine.
- Def: define a custom function.
- Return: Return from a subroutine.
- GoSub: Call a subroutine.
- Local: Define local variables for a subroutine.
- PushVariables and PopVariables: Change the way subroutines interact with variables.
Miscellaneous Commands
These command provides some miscellaneous functionality:
- Lines: Split an expression into lines
- Words: Split an expression into words or by a delimiter
- Exit: Exit an template ot an Internal Script
- Load: Load subroutines into the start of a template or into an internal script
- Log: Write information to the Console for possible debugging purposes.
- Import: Import text to a variable.
- Export: Export text to a file.
- Unset: Change variables and object to "undefined".
Additional Commands for Internal Scripting
These commands perform various other functions and are only available when using the language to write internal scripts: