Quote:
Originally Posted by ownedbycats
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.