Here's what I came up with:
Code:
program:
## list_remove_duplicates probably isn't necessary
list = list_remove_duplicates($#fanficrating, ',');
first_non_empty(
if 'Explicit' inlist list then 'Explicit' fi,
if 'Mature Audiences' inlist list then "Mature Audiences" fi,
if "Teen and Up Audiences" inlist list then "Teen and Up Audiences" fi,
if "General Audiences" inlist list then "General Audiences" fi,
if "Not Rated" inlist list then "Not Rated" fi
)
The first_non_empty question I was thinking of something along the lines of:
Code:
first_non_empty inlist list(
"Explicit",
"Mature Audiences"
"Teen and Up Audiences"
"General Audiences"
"Not Rated"
)