Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-27-2024, 03:29 PM   #706
foosion
Addict
foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.foosion is fluent in JavaScript as well as Klingon.
 
Posts: 231
Karma: 4562
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by chaley View Post
In Template Program Mode spaces are significant outside the template code. You can't put a space between the colon and the quote.
Taking out the space didn't help. I'm still getting error.

Code:
{#koboreadpct:'cmp($,100,#read,#kobolastread,#read)'}
#koboreadpct is Integers
#read and #kobolastread are both Date

Any of them might be blank.

??

EDIT: The program version worked. I do wonder why the above doesn't.


Last edited by foosion; 07-27-2024 at 03:54 PM.
foosion is offline   Reply With Quote
Old Today, 05:12 AM   #707
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: 9,176
Karma: 62872491
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Code:
program:
	status = readstatus();
	times = $$#timesread;
	readgoal = strcat('readinggoal:', format_date(today(), 'yyyy'));

	switch_if(
		status=='read', 'Read',
		status=='didnotfinish', 'Did Not Finish',
		status=='currentlyreading', 
			if times >#0 then 'Currently Rereading' 
			else 'Currently Reading' fi,
		status=='toberead', 'To Be Read',
		status=='unread', 
			if readgoal in $#admintags && $$#lastread then 'To Be Read' 
			elif readgoal in $#admintags then 'Backlog' 
			else 'Unread' fi,
		''
	)
Every book that matches unread and readgoal returns 'To Be Read', not just the ones with non-null dates. What did I do wrong?
ownedbycats is offline   Reply With Quote
Old Today, 05:35 AM   #708
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: 11,905
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Every book that matches unread and readgoal returns 'To Be Read', not just the ones with non-null dates. What did I do wrong?
A raw field reference returns the string None if the field is not defined. Use either
Code:
if readgoal in $#admintags && $$#lastread != 'None' then 'To Be Read'
or
Code:
if readgoal in $#admintags && raw_field('#lastread', '') then 'To Be Read'
chaley is offline   Reply With Quote
Old Today, 06:03 AM   #709
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: 9,176
Karma: 62872491
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Yes, that works. Thank you.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library Management: various questions not worth their own thread ownedbycats Library Management 156 07-23-2024 11:45 PM
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates Boilerplate4U Development 13 07-07-2020 02:35 AM
Questions on Kobo [Interfered with another thread topic] spdavies Kobo Reader 8 10-12-2014 11:37 AM
[OLD Thread] Some questions before buying the fire. darthreader13 Kindle Fire 7 05-10-2013 09:19 PM
Thread management questions meme Feedback 6 01-31-2011 05:07 PM


All times are GMT -4. The time now is 10:22 AM.


MobileRead.com is a privately owned, operated and funded community.