Copy File Name

Re: Copy File Name

Postby Natter » Fri Jan 21, 2022 5:03 pm

dim:=directory(MyFolder+"\*.*")
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Copy File Name

Postby karinha » Fri Jan 21, 2022 5:51 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7808
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Copy File Name

Postby Natter » Sat Jan 22, 2022 8:45 am

I did not make an empty text file .
https://cloud.mail.ru/public/jKRA/mDdPAAgoS
The header of this file consists of 3 characters D090 D090 CC86.
D0 is Cyrillic UTF-8. After reading this file through directory() I will get AA?.txt because the FW not recognize the CC86 symbol. This symbol must be deleted. I can edit the file headers in Explorer or TC, but there are a lot of files with the CC86 symbol in my name on the network (I haven't figured out where yet), You can rename such files from FW, apparently, through the bat file

chcp 1251
cmd ren C:\file1*.pdf file2.pdf

or bat file Powershell
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Copy File Name

Postby Otto » Sun Jan 23, 2022 7:54 am

Hello Natter,
I didn't think I would deal with this problem so quickly myself.
Are you using xHarbur or Harbour.
With Chinese characters my test program compiled with Harbor works fine. But not with xHarbour.



Best regards,
Otto
Code: Select all  Expand view

#include "fivewin.ch"
     #include "ini.ch"
     
     #include "adodef.ch"
     #include "ord.ch"
     #include "xbrowse.ch"
               
     function Main()
     
      local I, cVData
      local cReturn := ""
           
      HB_CDPSELECT( "UTF8" )
      FW_SetUnicode( .T. )
           
      aDir := directory( "C:\test\source\C*.*","DHS")
      xbrowse(aDir )
           
      cVData := aDir[1,1]
     
      for I := 1 to len(cVData)
        cReturn += (str(I) + "-" + cVData + CRLF + substr( cVData, I, 1 ) + " # "+ str( ASC ( substr( cVData, I, 1 ) ) ))  + CRLF
      next
           
      ? cReturn
     
      ? memoread( "C:\test\source\" + cVData ) 
     
     
     
     
    return nil
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Copy File Name

Postby Otto » Mon Jan 24, 2022 9:20 am

Dear Antonio,
with HARBOUR this is working fine. It is not working for me with xHarbour. But I switched the project to HARBOUR.

Best regards,
Otto
HARBOURINO now supports
HB_CDPSELECT( "UTF8" )
FW_SetUnicode( .T. )

Image

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Copy File Name

Postby Natter » Mon Jan 24, 2022 10:20 am

Otto, I built your program under Harbor and tried to read the file (not empty). I get empty :cry:
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Copy File Name

Postby cnavarro » Mon Jan 24, 2022 11:12 am

Look my screen ( file list on the left of the screen ) and tell me better your problem
Image
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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Jimmy and 96 guests