INTERACT FORUM

More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: exodus1977 on January 31, 2014, 02:16:10 pm

Title: Trouble with the IsEmpty(…) Function.
Post by: exodus1977 on January 31, 2014, 02:16:10 pm
I'm having some serious trouble getting the IsEmpty(…) function to pass the correct info and need some help. 

I have a custom user field called "Doc_Type". (I set it up as a string, not relational). If I select a file wherein the "Doc_Type" field is empty, and use the "Rename, Move, & Copy Files" dialog box, and use the expression editor to enter the following:

isempty([Doc_Type], 0)

I would expect to get an output of "1" (indicating that the field is indeed empty), but I don't. The output is "0". What is particularly odd is that if I simply switch the test mode to 1, as in the following:

isempty([Doc_Type], 1)

I get an output of "1". If I run this same test on another field that contains data, I get the same results. Its as if the function is simply returning whatever mode I specify.

Any ideas what is happening here?
Title: Re: Trouble with the IsEmpty(…) Function.
Post by: MrC on January 31, 2014, 02:36:59 pm
The RM&C tool treats field evaluation specially:

   http://wiki.jriver.com/index.php/Expression_Language#Field_Values:_Empty.2C_0.2C_and_1 (http://wiki.jriver.com/index.php/Expression_Language#Field_Values:_Empty.2C_0.2C_and_1)

It has to do this so that fields don't just collapse away, leaving a degenerate file or path name.  Imagine Rename working on a folder & file rule: [Artist]\[Album]\[Name].mp3  where Artist, Album and Name are empty: you're left with the string "\\.mp3".

So add ,0 to the end of your field, or compare against the field's display name using IsEqual().