View Single Post
Old 04-10-2021, 11:30 AM   #506
Venia Legendi
Member
Venia Legendi began at the beginning.
 
Venia Legendi's Avatar
 
Posts: 13
Karma: 10
Join Date: Apr 2013
Device: lots of, frequently changing
Lightbulb

Quote:
Originally Posted by capink View Post
I am not sure whether the above is explained clearly.
It is explained clearly, I just create a list of IDs for every format type and set the scope for the corresponding actions to these ID lists:
Code:
program:
# Get existing lists of book_ids
zeitung_ids = globals(zeitung_ids);
zeitschrift_ids = globals(zeitschrift_ids);

# Set the book variable otyp to the type
otyp = switch(field('title'), 
	".*\s+\(\d\d\.\d\d\.\d\d\d\d\)\s*", "Zeitung", 
	".*\s+\(\d\d/\d\d\d\d\)\s*", "Zeitschrift",
	"Unbekannt");
set_book_vars('otyp',otyp);

# Add to correspdonding id list
if otyp == 'Zeitschrift' then
	zeitschrift_ids = list_union(zeitschrift_ids, field('id'), ',');
	set_globals(zeitschrift_ids)
elif otyp == 'Zeitung' then
	zeitung_ids = list_union(zeitung_ids, field('id'), ',');
	set_globals(zeitung_ids)
fi
Works GREAT -
Venia Legendi is offline   Reply With Quote