Hi, I was wondering if there is a simpler or more elegant way to determine if the <curpath> when the tree has focus, or <curitem> when the list has focus, is the "root" directory of any drive. What I'm currently doing is using substr on the <curitem> and <curpath> like this...
Code: Select all
if(get("FocusedControl",) == "T") { // when tree has focus
if(substr("<curpath>", -1) == ":") {$root_warning = "1";}
if(get("FocusedControl",) == "L") { // when list has focus
if(substr("<curitem>", -2, 1) == ":") {$root_warning = "1";}
The input could be from the tree or List. It would be even better if the method worked regardless of focus. <curpath> when the tree has focus, the root drive is never back-slashed whereas, <curitem> when the list has focus, the root drive is back-slashed. Might there be a better way that I'm not aware of or stumbled across?
Thanks,
Ken