Single line, Make sure Directory Path ends with '\'

XypherXypher Posts: 297Member
edited 2009-02-09 in NAV Tips & Tricks
This is by no means a huge tip or trick, and it is quite bulky, but I think it's nifty. I use it all the time :mrgreen:
DirPath := DELSTR(DirPath,STRLEN(DirPath),STRPOS(DirPath[STRLEN(DirPath)],'\'))+'\';


  • tinoruijstinoruijs Posts: 1,223Member
    Nice variant you made!

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • XypherXypher Posts: 297Member
    tinoruijs wrote:
    Nice variant you made!

    Thanks. :D
  • wicwic Posts: 82Member
    or like CU11501 8)

    if (COPYSTR(_Input,STRLEN(_Input)) IN ) then
    ->please give correct path name.
    #### Only one can survive ######
  • XypherXypher Posts: 297Member
    Well that code is a bit different. It's just checking if the string ends with \ or / .

    The line of code I have provided doesn't check nor provide a response to the user. It just makes sure the ending of the path has a \ :wink:
  • gintuoklisgintuoklis Posts: 14Member
    a bit shorter way:
    Dir := DELCHR(Dir, '>', '\') + '\';
Sign In or Register to comment.