Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "salclem2" Newsgroups: it.comp.lang.visual-basic Subject: Re: funzione Dir Date: Thu, 8 Oct 2015 23:23:18 +0200 Organization: Aioe.org NNTP Server Lines: 33 Message-ID: References: <4cbc1bla3674309egh2l25i74tbvfiiqm8@4ax.com> NNTP-Posting-Host: M1ZWo+IB9FqzWsge1eH6MQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-15"; reply-type=response Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com it.comp.lang.visual-basic:18536 "Greg" nel suo ultimo post si è così espresso: > >> x& = GetFileAttributes ("G:\miofile.txt") > >> If x& > 0 Then MsgBox ("ESISTE") > > Grazie, alla fine ho usato la funzione Api e va tutto bene, ma vorrei capire perchè non funziona la Dir$ e la Dir > Ho provato a riscriverla cosi: > > Dim aa As String > aa = Dir$("c:\prova.txt") > e restituisce "prova.txt" > > mentre: > aa = Dir$("h:\prova.txt") > da errore 52 numero o nome di file non valido > > -- > Greg > Il motivo è semplice, perché esiste il drive H: ma non esiste il file, però se entrambi non esistono restituisce una stringa vuota. -- http://freewarewiki.it http://freewareonline.org http://netuser.altervista.org