View Single Post
Old 04-28-2021, 11:17 PM   #82
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,199
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by davidfor View Post
I assume that is a regex. If so, you will need to escape the square brackets. Add a backslash in before them.
As @davidfor pointed out, you should escape the brackets. Also the new inlist keyword can be used instead of list_contains() function:

Code:
program:
    k = field('#kobocoll');
    if check_yes_no('#onkobo', 0, 1, 0) then 'sync.png' 
    elif check_yes_no('#onkobo', 0, 0, 1) then
	    if '^\[Kobo Store\]$' inlist k then 'drm-locked.png'
	    elif '^\[Send to Device\]$' inlist k then 'sync.png'			
	    else 'reader.png'
	    fi
    fi
capink is offline   Reply With Quote