¿ªÔÆÌåÓý

trouble with lnested IF statements


 

Ok, so I am working on Calendar that also displays the weather. My output looks like this image -- note that I cycle through the entire month and display it all at once, each day one after the other.

What I am trying to do now is to get it to display the holiday information. The moon information was relatively easy, since I only had to deal with a single nested IF (i.e. checking the value of the %day% variable).

But for the Holidays, I need to check both the month and day. My code works fine as long as there does not need to be a second holiday in a month. If there is, it never displays the second holiday.

Note that I am calling the "Holiday" function/sub-table each time I build the contents of a given day (all my months have 30 days, so I basically loop 30 times, incrementing the day at the end before the next iteration)

I figure that my call to Holiday is the issue, so I could use some Advice....

:Holiday
1,{iif~%monthName%=Ceathmi?{iif~%day%=1?|holiday=New Year's Day|:|holiday=|}:
_{iif~%monthName%=Ceathmi?{iif~%day%=21?|holiday=Ostara (Spring Equinox)|:|holiday=|}:
_{iif~%monthName%=Asemi?{iif~%day%=5?|holiday=Beltane|:|holiday=|}:
_{iif~%monthName%=Sechtmi?{iif~%day%=21?|holiday=Litha (Summer Solstice)|:|holiday=|}:
_{iif~%monthName%=Anaomi?{iif~%day%=5?|holiday=Lunasa|:|holiday=|}:
_{iif~%monthName%=Adeimi?{iif~%day%=21?|holiday=Mabon (Autumnal Equinox)|:|holiday=|}:
_{iif~%monthName%=Dodhemi?{iif~%day%=4?|holiday=Sowain Eve|:|holiday=|}:
_{iif~%monthName%=Dodhemi?{iif~%day%=5?|holiday=Sowain Day|:|holiday=|}:
_{iif~%monthName%=Hamoi?{iif~%day%=21?|holiday=Yule (Winter Solstice)|:|holiday=|}:
_{iif~%monthName%=Atrimi?{iif~%day%=5?|holiday=Imbolc|:|holiday=|}:
_}}}}}}}}}}

(I really wish I could do something like

{iif~%monthName%=Ceathmi && %day%=1 ? |holiday=New Year's Day| : |holiday=|}

but I dn't think tablesmith support that, does it?

Anyways, any help would be appreciated!!


Join [email protected] to automatically receive all group messages.