cFilePath issue.

cFilePath issue.

Postby Horizon » Tue Oct 31, 2023 6:31 pm

Hi,

This function is in filename.prg in \fwh\source\function directory.
Code: Select all  Expand view
function cFilePath( cPathMask )   // returns path of a filename

   local lUNC := "/" $ cPathMask
   local cSep := If( lUNC, "/", "\" )
   local n := RAt( cSep, cPathMask ), cDisk

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


I used this function in my application. file path I noticed it was in uppercase. This creates problems with the Turkish characters I use. Is there a purpose in using the upper function? (Note. When I remove the Upper function, the problem disappears)

How can I replace the cFilePath function with my own function? I don't want to change this function in the entire application.

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: cFilePath issue.

Postby karinha » Tue Oct 31, 2023 7:20 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: cFilePath issue.

Postby nageswaragunupudi » Wed Nov 01, 2023 4:53 am

I think there should be no problem in removing Upper.

Meanwhile just for discussion, other ways are
Code: Select all  Expand view
cPath := BeforAtNum( "\", TrueName( cFile ) ) + "\"
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: cFilePath issue.

Postby Horizon » Wed Nov 01, 2023 7:45 am

nageswaragunupudi wrote:I think there should be no problem in removing Upper.

Meanwhile just for discussion, other ways are
Code: Select all  Expand view
cPath := BeforAtNum( "\", TrueName( cFile ) ) + "\"


Thank you Mr. Rao,

I understand that you recommend creating my own function and using it.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: cFilePath issue.

Postby nageswaragunupudi » Wed Nov 01, 2023 8:37 am

I understand that you recommend creating my own function and using it.

Not exactly.

We are going to remove Upper in the next version FWH2310 going to be released at any time.

I just availed the opportunity to discuss other options. Their functionality is not exactly like cFilePath
One more. Works only of if the file exists:
Code: Select all  Expand view
? FileSysObj():GetFile( cFile ):ParentFolder:Path
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 56 guests