View Single Post
Old 06-21-2021, 03:32 PM   #108
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
Code:
program:
s = $#kobostatus;
c = $#kobocoll;

first_non_empty
   (
    contains(s, "Send to Device", 'sync.png', ''),
    contains(s, "Kobo Store", 'drm-locked.png', ''),
    contains(s, "On Loan", 'overdrive.png', ''),
    contains(c, "[Want to Buy]", 'cart_full.png',''),
    contains(s, "Sideloaded", 'reader.png',''),
   )
Why does this return cart_full.png when [Want to Buy] isn't present in #kobocoll?
Because the string is a regular expression. The brackets make it a character class, matching any character.

Last edited by chaley; 06-21-2021 at 05:10 PM. Reason: Spelling
chaley is offline   Reply With Quote