Edit_TxT_PdF

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Edit_TxT_PdF

Post 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
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Edit_TxT_PdF

Post 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
Attachments
error.jpg
error.jpg (25.29 KiB) Viewed 4669 times
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Edit_TxT_PdF

Post 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
Viva INTERNATIONAL HMG :D
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Edit_TxT_PdF

Post 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
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Edit_TxT_PdF

Post 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
Attachments
EditTxTPdFDoC.zip
(153.96 KiB) Downloaded 529 times
Post Reply