* Re-Using Expressions

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
shoshk
Famous
Posts: 242
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re-Using Expressions

Post by shoshk » 16 Jun 2015 06:19

Hi All,

I've started to play with queries and I'm really liking the possibilities.

One thing that I'm discovering is that I often find myself defining a rather hairy expression for a column, which I would like to re-use in another queries.

Currently, I'm using copy-paste, but that's less than ideal, because if I want to change the expression, I have to edit it everywhere it is used.

It would be nice if FH provided for user-defined functions. ;)

Any suggestions for a strategy to manage this would be welcome.

Shosh
Shosh Kalson

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Re-Using Expressions

Post by tatewise » 16 Jun 2015 09:52

I sympathise with your problem Shosh, for which there is no simple solution.

There already is Wish List Ref 498 User Defined Macros (or Custom Functions) which is derived from posting User Defined Macros (6221) but has attracted few votes.

BTW: I guess you have discovered how_to:understanding_expressions|> Understanding Expressions and its links to Data References and Functions.

The only idea I can suggest is based on the fact that Queries, etc, are mostly saved in plain text files.
So a batch text editor, or FH Plugin, could perform global Find & Replace operations on those text files for the expression to be changed.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
shoshk
Famous
Posts: 242
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Re-Using Expressions

Post by shoshk » 16 Jun 2015 10:25

Mike,

I wondered about doing this with a plugin. Since it doesn't look like macros will be available in the near future, I guess I'll add it to my list of things to do.

Is the query file structure documented?

Shosh
Shosh Kalson

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Re-Using Expressions

Post by tatewise » 16 Jun 2015 11:21

Shosh,
None of the FH custom file types are documented, but they are not difficult to understand, especially when you know their details as shown in FH.
For Queries just check the folder below.
C:\ProgramData\Calico Pie\Family Historian\Queries\Custom
(or use File > Import/Export > Export > Query to the Project Public folder.)

Then open your saved Query (.fhq) file with a plain text editor such as Windows Notepad.

You will see each Column has the following format:
TAG="Record Id","=RecordId()",HIDDEN,DESC,38
where the comma separated parameters are:
1 "Heading"
2 "Expression" (note that simple Data Refs have no enclosing %)
3 Type: HIDDEN or BUDDY or blank
4 Sort: ASC or DESC or blank
5 Column width in quarter characters as adjusted in Result Set
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
shoshk
Famous
Posts: 242
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Re-Using Expressions

Post by shoshk » 16 Jun 2015 11:47

Thanks Mike.
Shosh Kalson

Post Reply