FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Dudas con la func铆o cGetFile
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Dudas con la func铆o cGetFile
Posted: Sat Feb 11, 2023 04:41 AM
Hola Amigos del foro:

Tengo el siguiente c贸digo con la funci贸n cGetFile() a la cual le pre asigno un nombre (cFileName)
y se muestra el di谩logo para que el usuario asigne un nombre de fichero, el dialogo contiene
dos botones ACEPTAR y CANCELAR.

La pregunta, c贸mo detectar cual bot贸n oprimi贸 el usuario?, ACEPTAR o CANCELAR?

Saludos
Code (fw): Select all Collapse
STATIC FUNCTION AExcel()
聽 聽cFilePath 聽 聽 聽:= ""
聽 聽 cFileName 聽 聽 聽:= "C1_" + DTOS(DATE())

聽 聽 cFilePath := cGetFile("*.Xlsx | *.Xlsx |*.Csv | *.Csv | *.* | *.*","Elija ruta y nombre del fichero",1,,(.T.),(.T.),,cFileName) + ".xlsx"

* Aqu铆 necesito saber que bot贸n eligi贸 el usuario <=================
RETURN(.T.)
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Dudas con la func铆o cGetFile
Posted: Sat Feb 11, 2023 05:23 AM

hi,

when press "Cancel" or "ESC" than cGetFile() will return empty String

but you have add ".xlsx" ... i would add it later

greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Dudas con la func铆o cGetFile
Posted: Sat Feb 11, 2023 02:45 PM
Code (fw): Select all Collapse
聽 聽If oBtn:lActive

聽 聽 聽 MsgStop("Botao ativo")

聽 聽Else

聽 聽 聽 MsgStop("Botao desativado")

聽 聽EndIf

贸:

聽 聽IsWindowEnabled( oControl:hWnd )
Regards, saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Dudas con la func铆o cGetFile
Posted: Sat Feb 11, 2023 05:08 PM

Jimmy:

You are right, I'll try.

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Dudas con la func铆o cGetFile
Posted: Sat Feb 11, 2023 05:09 PM

Karinha:

Thanks a lot,

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero

Continue the discussion