I’m trying to create an expression to generate an icon for military service in WWI and/or WWII; a separate icon should appear for each war. I’m running into a problem in that I currently have two expressions:
and=IsTrue(ContainsText(%INDI._ATTR-MILITARY_SERVICE%,"ww1",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[2]%,"ww1",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[3]%,"ww1",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[4]%,"ww1",STD))
The problem is that each searches for the text “wwi” and because “wwi” is contained within “wwii,” two icons (for each war) appear when only wwii should appear. I’m sure that the solution to prevent this from happening would be to add an additional item to each expression so that only the appropriate icon appears based on the year. For example, the WWII icon should only appear if the military service occurred between 1940 and 1945. Unfortunately, I have been trying, unsuccessfully, to add the correct code to the expression.=IsTrue(ContainsText(%INDI._ATTR-MILITARY_SERVICE%,"wwii",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[2]%,"wwii",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[3]%,"wwii",STD) or ContainsText(%INDI._ATTR-MILITARY_SERVICE[4]%,"wwii",STD))
Thanks for your help!