Thursday | 31 OCT 2024
[ previous ]
[ next ]

F Correlatives - Group Extraction

Title:
Date: 2023-05-06

A quick note on how to extract things using the group function in an f correlative. This is attribute 8 of a dictionary item and is used to do some processing while selecting displaying the record.

An F correlative is a stack machine and so the below code reads, we put 4 on the stack, this the attribute we want to get data from, we then do a group extraction using G and we say that we want to skip the first value, delimited by the colon and we want a single value.

F;4;(G1:1)

This F correlative will change:

Title: Some Blog Post Title

to:

Some Blog Post Title

Another example is:

F;3;(G1:2);(MCN);(DI)

This correlative takes

Date: 2023-05-07

And converts it to a date:

20216

The correlative takes the 3rd attribute, splits on the colon and grabs the value to the right. It then removes all characters except the number and then it does an internal conversion to get the universe date.

The dictionary can then get D conversion so that when you display the record the date will get put into some we can read. This way I can now do queries to see how many posts are in a specific month or year. Quite handy.

A helpful link about F correlaives, I learned that there are more than just F correlatives: