03-26-2021, 11:52 PM | #31 | |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Also this: https://en.wikipedia.org/wiki/Time_f...26,596_problem
Quote:
|
|
03-26-2021, 11:58 PM | #32 |
null operator (he/him)
Posts: 20,989
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
Advert | |
|
03-29-2021, 01:35 AM | #33 | |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
|
|
03-29-2021, 07:22 AM | #34 | |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
As I said on the report, I will highlight identifiers. Currently (in development) it looks like this. |
|
03-29-2021, 09:12 AM | #35 |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
29 Mar 2021 (in calibre source)
You can see both in this screen capture Last edited by chaley; 03-29-2021 at 02:12 PM. |
Advert | |
|
03-29-2021, 07:06 PM | #36 |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
The italics on the $lookupkey in source work.
|
03-29-2021, 07:19 PM | #37 |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Let me know if you can, or can't, figure out how to use the new breakpoints.
One problem: given how the template processor works internally there is a problem matching a line number to a particular 'thing'. I had to make 'if' statements work differently because it was difficult to put a breakpoint in the "else" clause (for example). Function calls split across multiple lines also are problematic. "Fixing" this is hard because during template execution line numbers are approximate. It seems that after more than 40 years of developing programming languages I would be able to do this without thinking. But I don't. Sigh ... |
03-29-2021, 07:31 PM | #38 |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I am taking some of my existing templates and trying to figure it out. One thing I notice is that the breakpoints are not saved after pressing OK to save the template and close the tester. Is that intended?
|
03-29-2021, 07:36 PM | #39 | |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Yes, it can make sense to try it on another book, but there is a "secret" feature to help with that. Select all the books you want to test, then open the tester. If you click on a book in the results list before clicking "Go" then that book will be used during breakpoint evaluation. |
|
03-29-2021, 07:37 PM | #40 |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I was testing it on the template I was having trouble with here (the one with the dates in the wrong order). I thought days_between would show up on the dialog. Did I misunderstand this?
|
03-29-2021, 07:43 PM | #41 |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
The issue I had with that template is probably what I would find breakpoints useful for, to make sure that when checking a value it actually is what I intended to check for (730 days instead of -730 days).
|
03-29-2021, 07:50 PM | #42 | |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
03-29-2021, 07:54 PM | #43 |
Wizard
Posts: 1,137
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Yes, it should make it easier to debug for all of us. I appreciate all the efforts chaley has put into this. Templates have made huge strides lately.
|
03-29-2021, 08:31 PM | #44 |
Custom User Title
Posts: 9,513
Karma: 64500171
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I see the same results if I set the breakpoint to #6. Hmm.
If you want to test the code itself with your own columns to see if you can make it appear, #fanficstatus is enumerated, #fanficupdated is date, and #fanficerror can probably be any column as it only checks if it's defined. Last edited by ownedbycats; 03-29-2021 at 08:52 PM. |
03-30-2021, 09:15 AM | #45 | |
Grand Sorcerer
Posts: 12,026
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Several changes:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A few questions... (template language, mainly) | Clem2605 | Library Management | 2 | 12-30-2020 04:25 AM |
Template Language | phossler | Calibre | 8 | 01-12-2016 05:37 PM |
Help needed with template language | Mamaijee | Devices | 12 | 02-19-2013 02:52 AM |
Help with template language | Pepin33 | Calibre | 8 | 11-11-2012 09:32 AM |
Template language question | BookJunkieLI | Library Management | 7 | 02-02-2012 07:55 PM |