View Single Post
Old 01-05-2023, 09:30 PM   #453
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,082
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thanks. Another question: what is the difference, if any, between using a first_non_empty and an if-then-elif in a situation like this?

first_non_empty is a bit easier for me (less misplaced fi's, for one!) so I'm inclined to keep it unless there's some large advantage to the other.

Code:
program:

	if $#booktype == 'Fanfiction' then
		first_non_empty(
			if 
				$#fanficstatus == 'In-Progress' 
				&& days_between(format_date(today(), 'yyyy-MM-dd'), $#fanficupdated) >= 365 
			then 
				'clock.png' 
			fi,
			
			if 
				!'^cover:' inlist $#admintags 
			then 
				'test' 
			fi
		)
	fi
Code:
program:

	if $#booktype == 'Fanfiction' then
		if 
			$#fanficstatus == 'In-Progress' 
			&& days_between(format_date(today(), 'yyyy-MM-dd'), $#fanficupdated) >= 365 
		then
 			'clock.png'

		elif 
			!'^cover:' inlist $#admintags 
		then
			'test'
		fi
	fi

Last edited by ownedbycats; 01-05-2023 at 11:49 PM.
ownedbycats is offline   Reply With Quote