FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour cFilePath() bug
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
cFilePath() bug
Posted: Wed Jul 05, 2006 08:52 AM
The followin sample shows "\" while it should show "" (empty string):

#include "Fivewin.ch"


FUNCTION MAIN()

    ? CFILEPATH( "test.txt" )

    RETURN NIL


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
cFilePath() bug
Posted: Thu Jul 06, 2006 11:20 AM
Enrico,

This may fix it:
function cFilePath( cPathMask )   // returns path of a filename

   local n := RAt( "\", cPathMask ), cDisk

return If( n > 0, Upper( Left( cPathMask, n ) ),;
           ( cDisk := cFileDisc( cPathMask ) ) + If( ! Empty( cDisk ), "\", "" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM

Continue the discussion