enum Bool
{
True,
False,
FileNotFound
};
See https://thedailywtf.com/articles/what_is_truth_0x3f_ enum Bool
{
True,
False,
FileNotFound
};
See https://thedailywtf.com/articles/what_is_truth_0x3f_ enom MsoTrioState {
Toggle,
Mixed,
True,
False,
CTrue
};I also like how True is -1. Beautiful all around!
msoTriStateMixed applies to aggregates. Eg, text.isBold() can be true, false, or a mix. Partly bold, partly not bold.
msoTriStateToggle isn't a real value but only used as a sort of flag. So eg, text.setBold(tristate), where "Mixed" would be invalid, and "Toggle" would flip the bold-ness of the text.
The msoCTrue one is where it gets really weird, no clue what's that for. I suppose an ill-conceived attempt to support the other way to express True.
True being -1 was a thing in Visual Basic and I suppose by some other Windows stuff. Logic being all the bits are 1.
So I suggested it, got a PR up (bit painful) it got reviewed, went in, everything worked fine, and we came about a week towards releasing the product (6 monthly releases) before someone noticed that we couldn’t load files from previous versions. Turned out that we wrote lots of these old Bool types to binary data files and so the 4 byte data was now being read as 1 byte data. Oops. Reverted the whole lot. Lesson in humility!