View Single Post
Old 11-13-2019, 06:33 AM   #11
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,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Not sure what to say. It works for me.

I used the following template (same as above)
Code:
program:
	test(
		and(
			strcmp(field('#keep_read'), 'yes', '', 1, ''),
			strcmp(field('#read_status'), 'N', '', 1, '')
		), 
		'Yes',
		'No');
and these column definitions:
Click image for larger version

Name:	Clipboard01.jpg
Views:	77
Size:	24.7 KB
ID:	174886

Click image for larger version

Name:	Clipboard03.jpg
Views:	70
Size:	29.7 KB
ID:	174887

Click image for larger version

Name:	Clipboard05.jpg
Views:	68
Size:	39.0 KB
ID:	174889

The next screen capture shows the input data and the result. There is exactly one "Y", which is the correct answer (as far as I know).
Click image for larger version

Name:	Clipboard04.jpg
Views:	61
Size:	14.7 KB
ID:	174888

---

For completeness I also tried it with #keep_read as a text column with the following definition.
Click image for larger version

Name:	Clipboard06.jpg
Views:	69
Size:	27.3 KB
ID:	174890

The following screen capture shows that the template still works.
Click image for larger version

Name:	Clipboard07.jpg
Views:	64
Size:	17.6 KB
ID:	174891

---

All I can suggest is that you check that:
  • you didn't change the template
  • the column definitions are the same as mine
  • the data is as you described (the same as mine).

This test template might help you work out where things are going wrong. It shows the result of the two strcmp functions.
Code:
program:
	strcat(
		'keep_read strcmp returns "',
		strcmp(field('#keep_read'), 'yes', '', 1, ''),
		'", read_status strcmp returns "',
		strcmp(field('#read_status'), 'N', '', 1, ''),
		'"')
chaley is offline   Reply With Quote