[ALREADY IMPL.] Variable formatting - categories - has value: Can we have an "else" option?

Started by Ferdinand, August 28, 2014, 03:46:58 PM

Previous topic - Next topic

Ferdinand

Regarding the option to format a categories variable, like {File.Categories.Direct} with a hasvalue option, like {File.Categories.Direct|Filter:Where; hasvalue:This file has a Where category}.

Would it be possible to have an else option, so that if it didn't have a value then we could use  {File.Categories.Direct|filter:^Where; hasvalue:This file has a Where category:This file does NOT have a Where category}.

Other formatting functions like "is" and "contains" already have this option.

Mario

No need for that.

1. hasvalue checks if the tag has data. If this is the case, the value given in hasvalue is returned. The purpose of this function is to emit a certain value if a tag is filled.

2. To emit a value when a tag is not filled, use the default function.

3. If you combine both, you can emit A when a tag is filled, and B if it is not filled.

For example:

{File.MD.XMP::exif\GPSLatitude\GPSLatitude\0|default:No GPS coordinate;hasvalue:GPS coded}

returns "No GPS coordinate" if the GPSLatitude is empty, and "GPS coded" when it is not empty.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

Thanks.   I did read the help file but didn't connect default and hasvalue.  Rather I compared hasvalue to is and contains.  I will suggest a small amendment to the help file in the appropriate manner.

Mario

Please use the feedback link at the bottom of the help page to send me your request.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

Quote from: Mario on August 29, 2014, 02:15:59 PM
Please use the feedback link at the bottom of the help page to send me your request.

Ahem.  That's exactly what I meant by "the appropriate manner".  Done already.

Mario

Too late. I've already added a sentence this morning to the help after posting my answer to your request  ;)
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand


Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook