Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lista completa: diretórios e arquivos
Message
De
04/04/2002 07:30:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00640626
Message ID:
00640795
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
Muito bem, Fabiano. Só uma pequena correcção e uma simples adição na robustez:

em vez de
if left(m.laDir(m.loop1,1),1)="."
será mais correcto
if m.laDir(m.loop1,1)=="." or m.laDir(m.loop1,1)==".."
em vez de
m.path+"\*" [...] m.path+"\"
é um pouco mais robusto
addbs(m.path)+"*" [...] addbs(m.path)
>Segue rotina:
>
>
>mostra_dir("c:\work")
>
>procedure mostra_dir(m.path as Character)
>if !used("cDir")
>	create cursor cDIR (dir c(254))
>endif
>local array m.laDir(1)
>local m.lnTotalDir as Number, m.loop1 as Number
>m.lnTotalDir=adir(m.laDir,m.path+"\*","ADHRS",1)
>for m.loop1=1 to m.lnTotalDir
>	if left(m.laDir(m.loop1,1),1)="."
>		loop
>	endif
>	insert into cDir (dir) values (m.path+"\"+m.laDir(m.loop1,1))
>	if "D"$m.laDir(m.loop1,5)
>		mostra_dir(m.path+"\"+m.laDir(m.loop1,1))
>	endif
>endfor
>return .t.
>
>
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform