Persistent Capitalization: another extended output formatting code

This isn’t the biggest change of all time, but it’s a darned useful one.¬† Once again, it’s using ! to extend an output formatting code.

Almost long as there has been a TableMaster, there have been the \C and \c output formatting codes. They arrived with embedded subtable calls, back in 1994 I think. And since 1994, it’s been bothering me that if that embedded call returns more than one word, only the first word will be capitalized. Most of the time, that’s what you want. But sometimes, you need a 2-word (or more) result, and you can’t just capitalize it in the table because that table is also being called elsewhere and shouldn’t be capitalized there. So for 24 years it’s been bothering me.

Well, I finally got around to taking care of that. In 1.4.4, you will be able to use \C! or \c! on an embedded subtable call to capitalize or lowercase the first letter of every word printed until the subtable call is complete. So this:

.table test

.print \C![Something].table Something.roll <1d3>1 the girls can
2 flirt and other3 queer things can do

…would give results like:

The Girls Can
Flirt And Other
Queer Things Can Do

(which, if you’re curious, is the mnemonic¬† … the polite one, anyway … for the Mohs mineral hardness scale: talc, gypsum, calcite, flourite, apatite, orthoclase, quartz, topaz, corundum, diamond)

Obviously this has some limitations. The biggest one is if that subtable happens to call another one, that will be treated the same way. Yuu need to plan a bit here.

I’ve also made .VARIABLE a bit more tolerant of being in .INCLUDEd tables. Basically, additional .VARIABLE declarations for the same name, if there’s an include in progress, are just passed over instead of throwing an error.

I still haven’t been able to surface that one bug so I can squash it. At the moment, I’m very close to doing a Microsoft and releasing an update with at least one known bug just to get it out the door. If I don’t find bug #86 (the offender) before I fix #87 (I know where that one is) and possibly add just one more new feature, and update the manual again, I’ll leave it that way, and be very grateful to anyone who can provide an extremely brief table that demonstrates the wretched thing, so I can finally squish it with extreme prejudice, or at least with my debugger.

And I’ve talked to someone who’s written more tables than I have. Scary, that! *waves* Hi!