|
|
#1 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,386
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Unset vs Undefined
For a column icon rule/saved search, is there any way to differentiate between an integer column value that has been deliberately set as "undefined" from one that has not been set at all?
I want to show an icon/make a search for books missing a value in #chaptercount, but a lot of books don't really have traditional chapters. I thought about just putting '0' in for those books, but that would appear in the book details and break the math if I want to divide pagecount by chaptercount or something.
Last edited by ownedbycats; 03-06-2021 at 06:49 PM. |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,529
Karma: 8074628
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Yes, with a GPM template. The following example shows you how to do the test. Up to you to figure out what you want to do in each case.
Code:
program:
x = raw_field('#myint');
if x == 'None' then
'Not Set'
else
strcat('Is Set to ', x)
fi
Code:
x = raw_field('#myint', -999);
Code:
#myint:true Last edited by chaley; 03-06-2021 at 07:04 PM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,529
Karma: 8074628
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Actually, for rules you don't need the GPM template. You can instead use a double condition, one checking that the value is set and the other checking the actual value.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sorting and undefined values | ownedbycats | Library Management | 3 | 07-22-2020 02:32 PM |
| Removal of undefined classes from text | mcdummy | Editor | 16 | 07-08-2020 08:45 AM |
| Is there way to list undefined classes? | phossler | Editor | 10 | 07-29-2018 10:33 PM |
| W3C Validation says: Elements are undefined | verydeepwater | ePub | 7 | 01-11-2013 06:09 AM |
| PRS-600 Sony library - Error undefined | omk3 | Sony Reader | 13 | 01-22-2010 11:52 AM |