View Single Post
Old 05-10-2022, 04:56 AM   #400
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: 8,657
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by ownedbycats View Post
I think one of the ids in the second section is checking the original state of the column and not the updated one.
I figured it out! I added two lines between the clauses, and it updated the variables. I suppose this might be a case where using variables as a typing shortcut wasn't a good idea.

Code:
program:
	ids = $identifiers;
	mobi = select(ids, 'mobi-asin');
	amazon = select(ids, 'amazon');

	if 
		mobi && !amazon
	then 
		n = re(mobi, '(.*)', '\1');
		ids = list_union(ids, strcat('amazon:', n), ',')
	else
		ids
	fi;

	mobi = select(ids, 'mobi-asin');
	amazon = select(ids, 'amazon');

	if 
		mobi == amazon
	then
		ids = list_difference(ids, strcat('mobi-asin:', mobi), ',')
	else
		ids
	fi

Last edited by ownedbycats; 05-10-2022 at 04:59 AM.
ownedbycats is offline   Reply With Quote