Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i have a list that might have a string as the first item or the list might be empty that i am giving to an expression. if there is such a string, i want the expression to be that string. but if the list is empty, i want an empty string (e.g. ''). the list can only have a string as item #0 or be empty. i'm drawing a blank trying to figure this out. it is not a variable. it can only appear once since the list itself is the result of an expression. any ideas?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
yeah, that's pretty easy and sure. but i need it
as an expression. the list will have a string in item #0 if it is not empty, so you don't need to test what type is there. if something is there, it can only be a string. if the list is empty, the value of the expression needs to be
''
(empty string).
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
maybe i do need to back up and solve a bigger issue. but this is the thing i'm working on, for now. the case in line 9 will never be a case to be considered. the list can only ever have strings be put in it. looking at it more broadly, i need to get whatever is in position #0 or get a ''. the code using this expects a string. but that expectation is fine. it just faces a possible empty list. i need to go look at that code, again.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.