microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
113 stars 11 forks source link

Support: What is the comment syntax? #61

Closed Greedquest closed 1 year ago

Greedquest commented 1 year ago

I have some code:

DIFFERENCE = LAMBDA(a, b, UNIQUE(VSTACK(a, b), , TRUE));
INTERSECT = LAMBDA(a, b, DIFFERENCE(UNIQUE(VSTACK(a, b)), DIFFERENCE(a, b)));
SUBTRACT = LAMBDA(subtractB, fromA, UNIQUE(VSTACK(UNIQUE(fromA), subtractB, subtractB), , TRUE));

In a module. I want to fill the comment field to add some descriptions. Is this supported? In the changelog it seems to be

https://github.com/microsoft/advanced-formula-environment/blob/0b35bab12c08251b7825cc98ef341a822de00215/CHANGELOG.md?plain=1#L10

but I cannot understand what that means and nothing I tried syncs the descriptions.

Otherwise amazing addin

Greedquest commented 1 year ago

Oh, I figured it out


/**Differences between 2 sets*/
DIFFERENCE = LAMBDA(a, b, UNIQUE(VSTACK(a, b), , TRUE));

/**Intersection of 2 sets (elements in both)*/
INTERSECT = LAMBDA(a, b,
    DIFFERENCE(UNIQUE(VSTACK(a, b)), DIFFERENCE(a, b))
);

/**Set subtraction A - B (elements in A not in B)*/
SUBTRACT = LAMBDA(subtractB, fromA,
    UNIQUE(VSTACK(UNIQUE(fromA), subtractB, subtractB), , TRUE)
);

see https://gist.github.com/Greedquest/e7b4e6863618e2f495a185902384d566

Multiline comments are allowed too and appear on multiple lines

/**
comment
second line
*/