Evaluator Column Empty column reporting error

2023-10-9 10:13 赋值器:  发生错误于 1,位置 8
Unknown value (6): desc
return(desc);

You need to check if the field is available:

return IsSet(desc) ? desc : "not set";

<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" foldertype="all" keyword="desc" maxstars="5" namerefresh="no" reversesort="no" title="desc" type="0">return IsSet(desc) ? desc : &quot;not set&quot;;</evalcolumn>
1 Like

My idea is that Dopus directly returns a empty string variable

Sometimes an empty value and a non-existent value mean different things. (Easier to consider numbers: 0 should mean the value is known to be zero, not "zero or missing/unknown".)

I don't think you can't have an empty description, but the distinction could be important for other fields. And if IsSet is needed for some fields, it might be best to ensure people are used to using it, by making it normal to check it for all fields.

(But this is not set in stone, and I didn't work on this part of the program, so I am just guessing why it works like this. In fact, I don't know if it also applies to numeric fields or just strings.)

Yes, it also applies to numeric fields.

I would suggest returning non-existent fields as "false/zero/empty/1970-01-01" rather than triggering an error.

In the majority of scenarios, distinguishing between an empty or non-existent value will not be necessary, and we can spare the extra steps. If it becomes crucial to differentiate, we can always use IsSet().

1 Like

I have a similar error code whenever files without extension are displayed.

10.10.2023 19:01 Evaluator:  Error at line 1, position 1
Unknown value (6): extdir
extdir
<?xml version="1.0"?>
<evalcolumn align="0" attrrefresh="no" autorefresh="no" category="loc" foldertype="all" header="Erw." keyword="extdir" maxstars="5" namerefresh="no" reversesort="no" title="Erweiterung (Verzeichnisse) kurz" type="0">extdir</evalcolumn>

Same problem, same solution :slight_smile:

return IsSet(extdir) ? extdir : "not set";

1 Like

Since it seems like this is going to be a point of confusion, we'll change it sooner rather than later (i.e. in the next beta) so that any keywords that aren't available return an empty string. You'll still be able to use IsSet() to test definitively whether they're available or not.

4 Likes