View Single Post
Old 04-28-2021, 10:48 PM   #81
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ownedbycats View Post
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 list_contains(k, ',', '^[Kobo Store]$', '1', '') then 'drm-locked.png'
	elif list_contains(k, ',', '^[Send to Device]$', '1', '') then 'sync.png'			
	else 'reader.png'
	fi
fi
For line 5 and 6, the presence of the square brackets makes the if statements not work and return reader.png instead. How do I fix that?
I assume that is a regex. If so, you will need to escape the square brackets. Add a backslash in before them.
davidfor is offline   Reply With Quote