Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unicode
Message
 
À
21/05/2009 12:15:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01401339
Message ID:
01401380
Vues:
48
Hi Chaim,

If filer return strings in UNICODE...
*...
Create Cursor (m.tcCursorName) ;
  (filepath M NOCPTRANS, filename M NOCPTRANS, ;
  FileSize i, fattr c(8), createtime T, lastacc T, lastwrite T)
*...
MartinaJ

>Hi
>I use VFP Filer for to find files (thanks to cetin Thread #981681 Message #981692).
>I can find all documents even if the file name in hebrew.
>The probem is with to find files wich contain strings in hebrew.
>
>Here is the code:
>
lcStartDir = "c:\"
>lnFiles = GetTree(m.lcStartDir,'*.doc', 'myCursor', .t.)
>Select * from myCursor order by filepath,filename
>
>Function GetTree
>Lparameters tcStartDir,tcSkeleton,tcCursorName,;
>  tlSubfolders,;
>  tlWholeWords,tlIgnoreCase,tlSearchAnd,tcSearch1,tcSearch2,tcSearch3
>Create Cursor (m.tcCursorName) ;
>  (filepath c(250), filename c(250), ;
>  FileSize i, fattr c(8), createtime T, lastacc T, lastwrite T)
>Local oFiler, lnFound
>oFiler = Createobject('filer.fileutil')
>With oFiler
>  .SearchPath = m.tcStartDir
>  .FileExpression = m.tcSkeleton && Search for skeleton
>  .Subfolder   = iif(m.tlSubfolders,1,0)  && Check subfolders
>  .IgnoreCase  = iif(m.tlIgnoreCase,1,0)
>  .WholeWords  = iif(m.tlWholeWords,1,0)
>  .SearchAnd   = iif(m.tlSearchAnd,1,0)
>  .SearchText1 = 'YXYXYXY'&&iif(empty(m.tcSearch1),"",m.tcSearch1)*****************************Here I will find all docs with 'YXYXYXY' content, but not hebrew string
>  .SearchText2 = iif(empty(m.tcSearch2),"",m.tcSearch2)
>  .SearchText3 = iif(empty(m.tcSearch3),"",m.tcSearch3)
>  lnFound = .Find(0)
>  For ix=1 To m.lnFound
>    With .Files(ix)
>      If !(Bittest(.Attr,4) And .Name = '.')
>        Insert Into (tcCursorName) ;
>          (filepath, filename, FileSize, fattr, createtime, lastacc, lastwrite)  ;
>          values ;
>          (.Path, .Name, .Size, Attr2Char(.Attr), ;
>          Num2Time(.Datetime), Num2Time(.LastAccessTime), Num2Time(.LastWriteTime))
>      Endif
>    Endwith
>  Endfor
>Endwith
>Return lnFound
>
>Function Num2Time
>Lparameters tnFloat
>Return Dtot({^1899/12/30}+Int(m.tnFloat))+86400*(m.tnFloat-Int(m.tnFloat))
>
>Function Attr2Char
>Lparameters tnAttr
>Return ;
>  IIF(Bittest(tnAttr,0),'RO','RW')+;
>  IIF(Bittest(tnAttr,1),'H','_')+;
>  IIF(Bittest(tnAttr,2),'S','_')+;
>  IIF(Bittest(tnAttr,4),'D','_')+;
>  IIF(Bittest(tnAttr,5),'A','_')+;
>  IIF(Bittest(tnAttr,6),'E','_')+;
>  IIF(Bittest(tnAttr,7),'N','_')
>
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform