cFilePath() bug

cFilePath() bug

Postby Enrico Maria Giordano » Wed Jul 05, 2006 8:52 am

The followin sample shows "\" while it should show "" (empty string):

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    ? CFILEPATH( "test.txt" )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Thu Jul 06, 2006 11:20 am

Enrico,

This may fix it:
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Thu Jul 06, 2006 12:00 pm

Thank you.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests