Hi all,
I propose to extend LSR snippet 543 (counters in markup,
http://lsr.dsi.unimi.it/LSR/Snippet?id=543) by adding a "getcounter"
command that does NOT increment a counter when called (as opposed to the
current "counter" command):
#(define-markup-command (getcounter layout props name) (string?)
"Prints out the value of the given counter named @var{name}.
If the counter does not yet exist, return 0."
(let* ((curval (assoc-ref counter-alist name))
(theval (if (number? curval) curval 0)))
(interpret-markup layout props
(markup (number->string theval)))))
I hope it will be useful to others as well.
Best regards,
Olivier
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user