@CatNoRecurse in formula gets replicated

Started by axel.hennig, June 24, 2024, 03:17:01 PM

Previous topic - Next topic

axel.hennig

I've got the following Category-tree:

sc1.jpg

The "test" category has the following formula:
"@CatNoRecurse[@All|Persons]"
If I click within "Properties" the three dots to edit the formula ("Edit Category Formula") and change the existing formula to:
"@CatNoRecurse[@All|Persons]" OR "Food"
Then clicking "Ok" closes the window without an error. Reopening the "Edit Category Formula" window shows the following:
"@CatNoRecurse[@All|Persons]" OR "@CatNoRecurse[Food]"
So the "@CatNoRecurse" part was added to "Food" without me doing anything.

This does not happen if I add the "Food" part before the other part, so:
"Food" OR "@CatNoRecurse[@All|Persons]"stays unchanged when closing and re-opening.

Mario

I'll look into it.
Word-around: "Food" OR "CatNo...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Found it. Fixed it.

The problem was caused by a flag that is set when @CatNoRecurse is encountered in the formulas token stream.
This flag was not reset when the next token was parsed. So the "Food" category was parsed as "regular group" but with the no recurse flag still set.

And when converting the parsed formula back into its string form, this caused "Food" to become "@CatNoRecurse[Food]".

Nice catch. Ancient bug.

Fixed for the next release.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook