Page 2 of 2

Re: Edit_TxT_PdF

Posted: Fri May 22, 2009 4:23 pm
by mustafa
esgici wrote:
mustafa wrote: I changed "Save a txt" is not taken TXT extension to write it only put the name of the file, the bad news is that if you keep on top of an existing file.txt is created with the same double extension such document.txt.txt
Hola Mustafa

Please try to adding

Code: Select all

  IF  "." $ Cfile  
    CfileD := Cfile 
  ELSE
    CfileD := Cfile+".txt"  
  ENDIF  
to Procedure TextoGraba between

cContenido := Frm_1.Edit_1.value

and

SetCurrentFolder( cPrgFolder )

Saludos

--

Esgici
Hello Esgici
I think it must run well
*-------------------------------*
Procedure TextoGraba
Cfile:=putfile({{'txt','*.txt'},{'Configuracion','*.ini'}},"Grab\arArchivo")
cContenido := Frm_1.Edit_1.value
IF "." $ Cfile
CfileD := Cfile
ELSE
CfileD := Cfile+".txt"
ENDIF
SetCurrentFolder( cPrgFolder )
IF MEMOWRIT(CFileD,cContenido,.T.)
ELSE
msginfo("No se pudo grabar el archivo ","ATENCION !!!")
RETURN
ENDIF
Frm_1.Edit_1.value:=" "
SAVE TO memuar ALL LIKE cFileD*
Convierte()
RETURN
*-------------------------------------*
testing your code does not touch but showed an error and SDF
was created with a single empty file extension. TXT nameless,
I do not see this error again

Date:22/05/2009 Time: 18:10:37
Error SDF/1001 Open error: .txt.txt (DOS Error 2)
Called from __DBAPP(0)
Called from __DBSDF(0)
Called from CONVIERTE(266)
Called from TEXTOGRABA(246)
Called from (b)MAIN(115)
Called from _DOCONTROLEVENTPROCEDURE(4394)
Called from EVENTS(1274)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4083)
Called from MAIN(158)

thanks for everything

Mustafa

Re: Edit_TxT_PdF

Posted: Fri May 22, 2009 5:06 pm
by mustafa
mustafa wrote:
esgici wrote:
mustafa wrote: I changed "Save a txt" is not taken TXT extension to write it only put the name of the file, the bad news is that if you keep on top of an existing file.txt is created with the same double extension such document.txt.txt
Hola Mustafa

Please try to adding

Code: Select all

  IF  "." $ Cfile  
    CfileD := Cfile 
  ELSE
    CfileD := Cfile+".txt"  
  ENDIF  
to Procedure TextoGraba between

cContenido := Frm_1.Edit_1.value

and

SetCurrentFolder( cPrgFolder )

Saludos

--

Esgici
Hello Esgici
I think it must run well
*-------------------------------*
Procedure TextoGraba
Cfile:=putfile({{'txt','*.txt'},{'Configuracion','*.ini'}},"Grab\arArchivo")
cContenido := Frm_1.Edit_1.value
IF "." $ Cfile
CfileD := Cfile
ELSE
CfileD := Cfile+".txt"
ENDIF
SetCurrentFolder( cPrgFolder )
IF MEMOWRIT(CFileD,cContenido,.T.)
ELSE
msginfo("No se pudo grabar el archivo ","ATENCION !!!")
RETURN
ENDIF
Frm_1.Edit_1.value:=" "
SAVE TO memuar ALL LIKE cFileD*
Convierte()
RETURN
*-------------------------------------*
testing your code does not touch but showed an error and SDF
was created with a single empty file extension. TXT nameless,
I do not see this error again

Date:22/05/2009 Time: 18:10:37
Error SDF/1001 Open error: .txt.txt (DOS Error 2)
Called from __DBAPP(0)
Called from __DBSDF(0)
Called from CONVIERTE(266)
Called from TEXTOGRABA(246)
Called from (b)MAIN(115)
Called from _DOCONTROLEVENTPROCEDURE(4394)
Called from EVENTS(1274)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4083)
Called from MAIN(158)

thanks for everything

Mustafa
Hola Esgici
creo que ya se lo que pasa con el error
si cargas un fichero para retocarlo y luego quieres guardarlo con su nombre u otro nombre pero cancelas la accion es cuando sale el error que te adjunto

Hello Esgici
I think it is what happens to the error
If you load a file you want to play and then save it with your name or other name but the action is canceled when you get the error attached

Mustafa greetings

Re: Edit_TxT_PdF

Posted: Fri May 22, 2009 6:54 pm
by esgici
Hola Mustafa

Please try following :

Code: Select all

Procedure TextoGraba

  Cfile:=putfile({{'txt','*.txt'},{'Configuracion','*.ini'}},"Grab\arArchivo")

  IF !EMPTY( Cfile )
    
     cContenido := Frm_1.Edit_1.value
     
     IF  "." $ Cfile  
       CfileD := Cfile 
     ELSE
       CfileD := Cfile+".txt"  
     ENDIF  
       
     SetCurrentFolder( cPrgFolder )
     
     IF MEMOWRIT(CFileD,cContenido,.T.)
       ELSE
        msginfo("No se pudo grabar el archivo ","ATENCION !!!")
       RETURN
     ENDIF
     
     Frm_1.Edit_1.value:="  "
     
     SAVE TO memuar ALL LIKE cFileD*          
     
     Convierte()
     
  ENDIF !EMPTY( Cfile )
 
  RETURN   
Saludos

--

Esgici

Re: Edit_TxT_PdF

Posted: Fri May 22, 2009 7:16 pm
by mustafa
esgici wrote:Hola Mustafa

Please try following :

Code: Select all

Procedure TextoGraba

  Cfile:=putfile({{'txt','*.txt'},{'Configuracion','*.ini'}},"Grab\arArchivo")

  IF !EMPTY( Cfile )
    
     cContenido := Frm_1.Edit_1.value
     
     IF  "." $ Cfile  
       CfileD := Cfile 
     ELSE
       CfileD := Cfile+".txt"  
     ENDIF  
       
     SetCurrentFolder( cPrgFolder )
     
     IF MEMOWRIT(CFileD,cContenido,.T.)
       ELSE
        msginfo("No se pudo grabar el archivo ","ATENCION !!!")
       RETURN
     ENDIF
     
     Frm_1.Edit_1.value:="  "
     
     SAVE TO memuar ALL LIKE cFileD*          
     
     Convierte()
     
  ENDIF !EMPTY( Cfile )
 
  RETURN   
Saludos

--

Esgici



Hello Esgici
As always you have gone faster with the solution, ja .... ja ....
I found another solucioón you can serve.
*---------------------------------------------------*
Procedure TextoGraba

Cfile:=putfile({{'txt','*.txt'},{'Configuracion','*.ini'}},"Grab\arArchivo")

cContenido := Frm_1.Edit_1.value

IF "." $ Cfile
CfileD := Cfile
ELSE
CfileD := Cfile+".txt"
ENDIF

SetCurrentFolder( cPrgFolder )

IF MEMOWRIT(CFileD,cContenido,.T.)
ELSE
msginfo("No se pudo grabar el archivo ","ATENCION !!!")
RETURN
ENDIF

Frm_1.Edit_1.value:=" "

SAVE TO memuar ALL LIKE cFileD*

RESTORE FROM MEMUAR ADDITIVE

IF cFile <= space(1)+".txt"
msginfo("Acción Cancelada","ATENCION !!!")
SAVE TO memuar ALL LIKE SPACE(1)
ERASE .txt
RETURN
ENDIF

Convierte()

RETURN
*----------------------------------------------------*
Many greetings
Mustafa

Re: Edit_TxT_PdF

Posted: Mon Jun 29, 2009 4:34 pm
by mustafa
Hola a todos les mando una prolongacion para convertir tambien a Doc

Hello command them to become an extension to Doc

Greetings

Mustafa