cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Checking for element content in FOSI

ebenton
1-Newbie

Checking for element content in FOSI

I am having some trouble getting my screen FOSI to perform the way I expect it to. I have an element which may or may not have content.

When the element has no content I want to save the word "None" as a text variable and use it elsewhere.

When the element DOES have content I want to save the actual contents as the same text variable name and use it in the same location as the "None".

It works fine when I just save the element content as a text variable and use it elsewhere, except that I get blank content when used elsewhere, instead of the word "None", when there is no content. We would prefer the word "None".

I am trying to use an <att> to test for the existence or non-existence of a value for a the above-described text variable

Let's assume the text variable name is "a.txt". It doesn't seem to matter whether I use <specval attname="a.txt" attloc="#FOSI" attval="#ANY">, <specval attname="a.txt" attloc="#FOSI" attval="#NE#\\"> for the #ANY case

Nor does it seem to matter whether I use <specval attname="a.txt" attloc="#FOSI" attval="#NONE"> or <specval attname="a.txt" attloc="#FOSI" attval="#EQ#\\"> for the #NONE case.

The behavior is inconsistent. If I change it from "#ANY" to "#NE#\\" it will work, but then if I delete the element contents, the text variable value remains the same, as if it still has content.

Similar behavior occurs with the "#NONE" or "#EQ#\\" and adding element content.

I am starting to think that maybe FOSI can't perform this kind of test. Does anybody have any experience with this?
1 REPLY 1

Hi Ed-



I'm not sure if there's a pure FOSI way to do this. But there's an
example in the online help of how to do it using SYSTEM-FUNC. Check out
help 1325, in the section "Using the return value of a function as an
attribute value" (or search for "emptytestfunc").



--Clay


Top Tags