Trivial double-entry bookkeeping example

Hi,

I try to create a very simple "language" for simple double-entry bookkeeping. So far ConceptDeclarations for Root (containing Accounts and Transactions), Account, Accounts (containing Account's), Transaction, Transactions (containing Transaction's) got created.

Now I'm stuck at the Accounts_Editor, which simply should contain a horizontal layout with a constant text ("Accounts:") and a vertical list of the available accounts. How do I show a list of accounts (0..n aggregation of ConceptDeclaration Account's)?

Also, a Transaction references a 'credit' and 'debit' Account. How do I make the Account's choosable in the Transaction_Editor?

Thanks in advance.

Tom

0
2 comments

Hi Thomas,

for creating a list for many children in the same role, use ref.node list meta-cell. Just select a cell type "ref.node list(vertical)" from the list and give it an appropriate link (in your case, the link defined in Accounts with target  concept Account, I don't know what name you have given to this link).

for creating a cell for a referenced or aggregated node use "ref.node" or "ref.cell" meta-cell. If you want to use an editor defined for the target node's concept, choose "ref.node". If you want to show the target node in some other way (e.g. show only its name or only some of its properties , etc.) use "ref.cell": it will be like creating a new editor declaration inline.

Maybe the humble overview of the core MPS languages which is now included into the build (see the Help menu) will help you in your further language development.

0

Thank you very much for your answer. Will take a detailed look at the documentation.

0

Please sign in to leave a comment.