Evaluator Parent() enhancement

I added the path to the selected item in the status bar for easy viewing but sometimes the path is too long and I only need to know a few folders at the end.
Request parameters like this:
File path D:\Test\New Folder\Test\Test.txt
Parent(Val("sel:path"), -3) // New Folder\Test\Test.txt
If the path level is not sufficient, use the full path.
e.g. D:\Test\Test.txt Parent(Val("sel:path"), -3) // D:\Test\Test.txt

Nice idea.

Might make sense to have a function to truncate paths at either or both ends.

For example PathTrunc("C:\1\2\3\4\5\6", 2, 3) might return C:\1\...\4\5\6.

1 Like

In the next beta we'll add both of these. FilePart() (rather than Parent()) will be able to return more than one component from the end of the path, and a new function Truncate() will let you automatically truncate a path to a specified length.

3 Likes

Thanks for the enhancement. This status bar code works better than Truncate() for some of my paths.
<#5C97DE>{=selPath = Val("sel:path"); (Len(selPath) > 60) ? Root(selPath) + "\...\" + FilePart(selPath,3) : selPath=}