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

XypherXypher Member Posts: 297
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)],'\'))+'\';

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    8)
    Nice variant you made!

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

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

    if (COPYSTR(_Input,STRLEN(_Input)) IN ) then
    ->please give correct path name.
    #### Only one can survive ######
  • XypherXypher Member Posts: 297
    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 Member Posts: 14
    a bit shorter way:
    Dir := DELCHR(Dir, '>', '\') + '\';
    
Sign In or Register to comment.