It took me a surprisingly long time to code even this table, needed for some debugging.
16:54:04.029 -> i File Year Day Until
16:54:04.029 -> 0 129 2023 309 123
16:54:04.029 -> 1 136 2023 311 123
16:54:04.029 -> 2 137 2023 312 123
16:54:04.029 -> 3 78 2023 315 123
16:54:04.029 -> 4 82 2023 316 123
16:54:04.029 -> 5 138 2023 321 123
16:54:04.029 -> 6 131 2023 359 123
16:54:04.029 -> 7 71 2023 360 123
16:54:04.029 -> 8 96 2023 365 123
16:54:04.029 -> 9 95 2023 1 123
16:54:04.029 -> 10 90 2023 17 123
16:54:04.029 -> 11 139 2023 40 123
But although it serves its purpose, how could I have most quickly made it look like this tidy version please?
16:54:04.029 -> i File Year Day Until
16:54:04.029 -> 0 129 2023 309 123
16:54:04.029 -> 1 136 2023 311 123
16:54:04.029 -> 2 137 2023 312 123
16:54:04.029 -> 3 78 2023 315 123
16:54:04.029 -> 4 82 2023 316 123
16:54:04.029 -> 5 138 2023 321 123
16:54:04.029 -> 6 131 2023 359 123
16:54:04.029 -> 7 71 2023 360 123
16:54:04.029 -> 8 96 2023 365 123
16:54:04.029 -> 9 95 2024 1 123
16:54:04.029 -> 10 90 2024 17 123
16:54:04.029 -> 11 139 2024 40 123
(BTW, when composing this, that did not faithfully show my intended text. So I made a screnshot instead. But after Send, it now looks OK.)
The maximum values of i, File and Day are 99, 999 and 366 respectively. All values are int types. Here's my code:
void listAllEvents()
{
int eventArraySize = sizeof(notableEvents) / sizeof(notableEvents[0]);
Serial.print(F("eventArraySize = "));
Serial.println(eventArraySize);
Serial.println(F(""));
Serial.println(F("ALL EVENTS CURRENTLY DEFINED"));
Serial.println(F("----------------------------"));
Serial.println(F("i File Year Day Until"));
for (i = 0; i <= eventArraySize-1; i++)
{
Serial.print(i);
Serial.print(F(" "));
Serial.print(notableEvents[i].fileNumber); // 'File' in table
Serial.print(F(" "));
Serial.print(Year);
Serial.print(F(" "));
Serial.print(notableEvents[i].dayOfYear); // Year in table
Serial.print(F(" "));
Serial.println(F("123")); // temporary
}
while (1 == 1); // Stops program from proceeding
} // End listAllEvents
Not sure if it's relevant, but the source of File and Day is from a struct; here's an extract:
struct NotableEvent
{
int fileNumber;
int dayOfYear; //
};
NotableEvent notableEvents[] =
{
{129, 309},
{136, 311},
{137, 312},
{78, 315},
{82, 316},
{138, 321},
{131, 359},
{71, 360},
{96, 365},
{95, 1},
{90, 17},
{139, 40},
etc