Expand description
GridCraft macros: typed, declarative command lists that run as one undo step. They are not VBA:
a VBA project in a file is carried through unchanged (Workbook::vba_project) and never run.
Structs§
- Macro
- A recorded or hand-made macro: a list of typed steps that runs as one undo step. Most steps run
a GridCraft command; Repeat, If and Stop add bounded control flow. References in step
parameters can be tokens (
"Input.col(2)") that are resolved against the declared inputs when the macro runs, so a macro recorded on one block of data works on another. - Macros
- The macros of a workbook. Workbook snapshots share the list until one of them changes it, so
an undo entry or a copy made for a cell edit holds the same list rather than a copy of every
step. Reads go through
Derefto the list; a write throughDerefMutfirst copies the list when another snapshot shares it. - Named
Input - A range the macro works on, with the shape and content it expects.
- Output
Rule - Where a macro’s results go.
- Step
- One macro step and its editor flags.
Enums§
- ColType
- What a column of an input must hold. Empty cells pass unless the input is
non_empty. - Compare
Op - Input
Kind - OnConflict
- Repeat
Of - Step
Kind
Constants§
- MACRO_
VERSION - The macro format version written by this build.
- MAX_
MACROS - The most macros a workbook keeps.
- MAX_
MACRO_ COLUMNS - The most column types an input lists: one per column of a sheet.
- MAX_
MACRO_ DEPTH - How deeply Repeat and If may nest (a top-level step is at depth 1).
- MAX_
MACRO_ NAME - The longest macro or input name, in characters.
- MAX_
MACRO_ PERMISSIONS - The most commands a macro’s permissions list.
- MAX_
MACRO_ REF - The longest reference or token in a macro (an output anchor, an input’s default range, a Repeat’s range, an If’s cell), in characters.
- MAX_
MACRO_ SHORTCUT - The longest shortcut text (
Ctrl+Shift+M), in characters. - MAX_
MACRO_ STEPS - The most steps in one macro, counting the steps inside Repeat and If.
- MAX_
MACRO_ TEXT - The longest macro description, step note, Stop message or If value (as JSON), in characters.
Functions§
- check_
version - Refuses a format version newer than
MACRO_VERSION: this build would drop the fields it doesn’t know, and a save would then write the rest back as if it were the whole macro.