Correct hasvalue: Syntax In FWT

Started by Darius1968, June 13, 2022, 04:43:48 PM

Previous topic - Next topic

Darius1968

In one of the FWT's input fields, this works: 
{File.MD.XMP::dc\description\Description\0|pereplace:{cr}{lf}==</Run> <LineBreak/> <Run Foreground="#ffaa00" FontSize="9pt">;prefix:<Run Foreground="#ffaa00" FontSize="9pt">;postfix:</Run><LineBreak/>}

However, this doesn't: 
{File.MD.XMP::dc\description\Description\0|hasvalue:{File.MD.XMP::dc\description\Description\0|pereplace:{cr}{lf}==</Run> <LineBreak/> <Run Foreground="#ffaa00" FontSize="9pt">;prefix:<Run Foreground="#ffaa00" FontSize="9pt">;postfix:</Run><LineBreak/>}}

The latter expression is my attempt to output the Description tag only if there is a value because there is a line-feed at the end to accommodate yet another tag that follows, if it too has a value. 
So, what is wrong with my last expression, and how to fix it? 

Mario

'Doesn't' means what? Something explodes? Screen goes blank? Beep? Unexpected output? Missing parts in the output?

When I copy & paste your expression into a FWT (for other users: this means File Window Tip) I get no syntax error.

Did you copy your variable into the VarToy and debugged it? Reducing it down to the minimum viable variable statement to check if and when whatever happens that happens?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook