cGetfile for saveas?
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
cGetfile for saveas?
Hi,
I have a program where the user can select an excel-file where he can import data from into the program.
He can set this in the settings of the program. He can browse the PC, and select the file. I'm using cGetile() for this.
Now I want also a setting where he can set an excel-file to export to. I want also the posibility that he can browse, and enter a name, just like a saveas in excel.
If I use cGetfile, I can enter a name, and press 'OPEN'. But this is confusing, because it is not an open, but a saveas.
I have a program where the user can select an excel-file where he can import data from into the program.
He can set this in the settings of the program. He can browse the PC, and select the file. I'm using cGetile() for this.
Now I want also a setting where he can set an excel-file to export to. I want also the posibility that he can browse, and enter a name, just like a saveas in excel.
If I use cGetfile, I can enter a name, and press 'OPEN'. But this is confusing, because it is not an open, but a saveas.
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: cGetfile for saveas?
Try with
Code: Select all
cFile := cGetFile32( , FWString("Save as"), 0, ;
hb_CurDrive() + ":\" + CurDir(), .T., .T. )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: cGetfile for saveas?
Thank you.
Is's working fine
Is's working fine
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: cGetfile for saveas?
Master, esto no funciona.
Code: Select all
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------//
FUNCTION Main()
local oBar
DEFINE WINDOW oWnd TITLE "SALVAR COMO" // save as
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION SALVAR_COMO()
SET MESSAGE OF oWnd TO "SALVAR COMO" NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION SALVAR_COMO()
LOCAL cFile
cFile := cGetFile32( , FWString("Save as"), 0, ;
hb_CurDrive() + ":\" + CurDir(), .T., .T. )
RETURN NIL
João Santos - São Paulo - Brasil
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: cGetfile for saveas?
What error do you get?karinha wrote:Master, esto no funciona.
Code: Select all
#include "FiveWin.ch" static oWnd //----------------------------------------------------------------// FUNCTION Main() local oBar DEFINE WINDOW oWnd TITLE "SALVAR COMO" // save as DEFINE BUTTONBAR oBar _3D OF oWnd DEFINE BUTTON OF oBar ACTION SALVAR_COMO() SET MESSAGE OF oWnd TO "SALVAR COMO" NOINSET CLOCK DATE KEYBOARD ACTIVATE WINDOW oWnd RETURN NIL FUNCTION SALVAR_COMO() LOCAL cFile cFile := cGetFile32( , FWString("Save as"), 0, ; hb_CurDrive() + ":\" + CurDir(), .T., .T. ) RETURN NIL
I use
and it's working fine.cGetFile32( '*.xlsx| *.xlsx', "Save as", 0, 'c:\temp' , .T., .T. )
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: cGetfile for saveas?
Marc.
Excuse me, do you means to change the button text from 'open' to 'save as'?, because I tried and not works.
Maybe fivewin version? I use 1204.
Regards
Excuse me, do you means to change the button text from 'open' to 'save as'?, because I tried and not works.
Maybe fivewin version? I use 1204.
Regards
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: cGetfile for saveas?
Marc.Marc Vanzegbroeck wrote:If I use cGetfile, I can enter a name, and press 'OPEN'. But this is confusing, because it is not an open, but a saveas.
Excuse me, do you means to change the button text from 'open' to 'save as'?, because I tried and not works.
Maybe fivewin version? I use 1204.
Regards
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Re: cGetfile for saveas?
FranciscoA wrote:Marc.
Excuse me, do you means to change the button text from 'open' to 'save as'?, because I tried and not works.
Maybe fivewin version? I use 1204.
Regards
+ 1
Regards.
João Santos - São Paulo - Brasil
Re: cGetfile for saveas?
http://wiki.fivetechsoft.com/doku.php?i ... cgetfile32FranciscoA wrote:Marc.
Excuse me, do you means to change the button text from 'open' to 'save as'?, because I tried and not works.
Maybe fivewin version? I use 1204.
Regards
Yes, this change button "open" with "save"
This run ok with my version of Fwh
Code: Select all
cFile := cGetFile32( "Project (*.prj) |*.prj|", "Save as", ;
0, hb_CurDrive() + ":" + cPathPrj + CurDir(), .T., .T. )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: cGetfile for saveas?
I do as follow and not works. The original button text is 'Guardar' and still same.
cFile := cGetFile32("Respaldos | *.Sql |","Abrir",0, cDirBackUp,.T.,.T.)
Regards.
cFile := cGetFile32("Respaldos | *.Sql |","Abrir",0, cDirBackUp,.T.,.T.)
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
- FranciscoA
- Posts: 1964
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: cGetfile for saveas?
Thanks, Cristobal. I had not seen the link.
This is the right way:
This is the right way:
Code: Select all
cFile := cGetFile32( "Respaldos | *.Sql |", "Seleccione respaldo" ,0, cDirBackUp,.F.,,) // .f. = Abrir
cFile := cGetFile32( "Respaldos | *.Sql |", "Seleccione respaldo" ,0, cDirBackUp,.T.,,) //.t. = Guardar
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Chinandega, Nicaragua.
Fwxh1204-MySql-TMySql
Re: cGetfile for saveas?
Is it possible to pass a default file name and hence to let the user to accept the given name or change it if he wish.
Re: cGetfile for saveas?
Solved, we can use cInitialFile as shown below
cGetFile( <cFileMask>, <cTitle>, [<nDefaultMask>], [<cInitialDirectory>], [<lSave>], [<lLongNames>], [<nFlags>], [<cInitialFile>] ) –> cFileName
cGetFile( <cFileMask>, <cTitle>, [<nDefaultMask>], [<cInitialDirectory>], [<lSave>], [<lLongNames>], [<nFlags>], [<cInitialFile>] ) –> cFileName