Closed curiousdannii-testing closed 2 years ago
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by graham :
In the change log this appears as a minor new feature, as follows -
The number of blank rows in a table can now be specified using a named
constant, like so:
The spare capacity is always 10.
Table of Stuff
whatever (a number)
with spare capacity blank rows
The named constant must, of course, hold a non-negative integer. Note that
it is allowed to be 0, which adds no blank rows. Inform doesn't allow
completely empty tables, so if, as in this case, there are no explicit rows
and the name comes out to 0 as well, Inform quietly gives the table a single
row of blanks, but does compile it. (See bug report 0001724.)
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by mattweiner :
This would also have been nice in my game which represented a grid with a table--I used "grid size" for a lot of the grid calculations and it would've been nice to be able to specify the table as having grid size squared rows, which would've let me change the grid size by changing the constant rather than risk the table getting out of sync with everything else.
Reported by : dfremont
Description :
Defined number constants can't be used in the "with N blank rows" syntax at the end of a table. It's possible this is intentional, but I again plead the omnibus WI 4.13 statement that defined constants can be used in contexts where only constant values are allowed.
Steps to reproduce :
Additional information :
One reason why this would be helpful, in case anyone wonders: if an extension defines multiple tables which must all be the same size, this would allow them all to be simultaneously resized by a user in a simple way (by replacing the constant definition, given in its own section). Of course this also helps anyone implementing such parallel tables avoid bugs from deciding to make one table bigger and forgetting to adjust the others.
imported from: [Mantis 1724] Defined constants can't be used as number of blank rows