View Single Post
Old 03-30-2023, 12:04 PM   #536
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,095
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
While trying to set up the template in #530 I found a failure point that I'm surprised I managed to miss:

Code:
program:

	if 
		!$#purchasesource=="Amazon"
		&& select($identifier, 'amazon')
	then
		list_difference ($identifier, strcat('amazon:', select($identifier, 'amazon')), ',')

	elif 
		!$#purchasesource=="Barnes & Noble"
		&& select($identifier, 'barnesnoble')
	then
		list_difference ($identifier, strcat('barnesnoble:', select($identifier, 'barnesnoble')), ',')

	elif 
		!$#purchasesource=="Kobo"
		&& select($identifier, 'kobo')
	then
		list_difference ($identifier, strcat('kobo:', select($identifier, 'kobo')), ',')
	
	elif 
		!$#purchasesource=="Baen"
		&& select($identifier, 'baen')
	then
		list_difference ($identifier, strcat('baen:', select($identifier, 'baen')), ',')
	fi
If it finds one unwanted identifier, it would then skip the rest. What should I use instead of if-thens?
ownedbycats is offline   Reply With Quote