View Single Post
Old 01-04-2023, 07:59 AM   #450
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
As part of a first_non_empty, I have a if-then that checks that:

a) #kobostatus is defined
b) #kobostatus is also not 'Kobo Store'
c) #kobopath is undefined

Code:
if $#kobostatus && !'Kobo Store' in $#kobostatus && !$#kobopath then 'snippets.png' fi
Is there a slightly better way to check the first two?
Depends on what #kobostatus is. If it is a list then what you have is good. If #kobostatus is a single-valued field (enum perhaps) then
Code:
$#kobostatus != 'Kobo Store'
is faster.
Quote:
EDIT: Additional question:

Code:
program: 

days_between(format_date(today(), 'yyyy-MM-dd'), $#fanficupdated);

days_between(today(), $#fanficupdated);
What is the difference between these two lines? On most of the books I tested (but not all of them; perhaps timezone?) there's a difference of 1.
The second includes the time of day while the first doesn't. The function uses the number of seconds between the values in the calculation. For the first the number of seconds in the first argument is zero. For the second the number of seconds is whatever it is based on the time of day.

If both are complete times (date, time, timezone) then the difference in the time of day will figure in the date arithmetic.
chaley is offline   Reply With Quote