FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Also for filename and subdir Resolved
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Also for filename and subdir Resolved
Posted: Sun Mar 15, 2020 05:27 PM
I have a file image on

cPathMask:="C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png"

the image is pattino.png

I wish save on record (dbf) only bitmaps\servizi\pattino.png

I saw also filename.prg and not found a solution

Function test()

Local cIniFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "Test.ini"
Local cExePath := cFilePath( GetModuleFileName( GetInstance() ) )

Local cSerPath := GetIni( cIniFile, "Config", "Ser", cExePath+"bitmaps"+"\servizi\")
Local cPathMask:="C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png"
Local only_Image := cFileNoPath( cPathMask )
? only_Image
nSTART := RAT( "\", only_Image )
?SUBSTR(cPathMask,1,nSTART-1)
any solution please
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Also for filename and subdir
Posted: Sun Mar 15, 2020 11:20 PM
Excuse me, I don't understand what you need
I attach some code

Code (fw): Select all Collapse
Function Main()
Local cIniFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "Test.ini"
Local cExePath := cFilePath( hb_Argv(0)  ) //cFilePath( GetModuleFileName( GetInstance() ) )
Local nStART
//Local cSerPath := GetIni( cIniFile, "Config", "Ser", cExePath+"bitmaps"+"\servizi\")
Local cPathMask:="C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png"
Local only_Image := cFileNoPath( cPathMask )
? cExePath
? only_Image
//nSTART := RAT( "\", only_Image )    // If you apply cFileNoPath to cPathMask, it is impossible obtain any "\"
nSTART := RAT( "\", cPathMask )
? SUBSTR( cPathMask, 1, nSTART - 1 ), cFilePAth( cPathMask )
Return nil
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Also for filename and subdir
Posted: Mon Mar 16, 2020 12:06 PM

I need it return me " .\bitmaps\servizi\pattino.png"

I wish erase cExePath from "C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png"
cEXePath is "C:\Work\Prg\WinBeach\"

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Also for filename and subdir
Posted: Mon Mar 16, 2020 01:26 PM
Silvio.Falconi wrote:I need it return me " .\bitmaps\servizi\pattino.png"

I wish erase cExePath from "C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png"
cEXePath is "C:\Work\Prg\WinBeach\"


Then
Code (fw): Select all Collapse
? StrTran( "C:\Work\Prg\WinBeach\bitmaps\servizi\pattino.png", cExePath, "" )
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Also for filename and subdir
Posted: Mon Mar 16, 2020 07:07 PM

Nice!
Thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion