🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #255

Re: Ciclo 'For each file in.....'

#255
From: Rafunk
Date: Thu, 16 Nov 2006 11:57
41 lines
2181 bytes
AntFast wrote:
> Ciao a tutti.
> Come si fa riportare il controllo all'inizio del ciclo
> 'for each file in ......'
> Cioe', se si e' verificata una condizione, deve saltare
> il codice che viene a valle (codice2) e ripartire dal
> 'for each file in ......'   Esempio:
>
> for each file in fld.Files
>    ....codice
>    ....codice
>    if condizione then
>        torna a for each.....     <-------
>    endif
> ....codice2
> ....codice2
> next
> Grazie in anticipo per l'eventuale risposta
> AntFast

Basterebbe strutturarla cos�:
for each file in fld.Files
   ....codice
   ....codice
   if NOT condizione then
    ....codice2
    ....codice2
   endif
next

Sempre che tu non voglia reinizializzare il loop, ripartendo dal primo elemento.
In tal caso sei costretto ad usare GoTo (che si dovrebbe usare con parsimonia
per evitare di rendere poco leggibile e "spaghettoso" il codice).


Bye

Raf

-----------------------------------------------------
Funk: cooler than the other side of the pillow.
Technical Details
Message-ID: <455c525a$0$7637$4fafbaef@reader1.news.tin.it>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!nntp.eutelia.it!feeder.news.tin.it!spool.news.tin.it!not-for-mail
References: <VqP6h.9067$mZ5.239@tornado.fastwebnet.it>

Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,1434dad1ca015974
X-Google-Attributes: gidf94ee,public
X-Google-Language: ITALIAN,CP1252
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!nntp.eutelia.it!feeder.news.tin.it!spool.news.tin.it!not-for-mail
From: "Rafunk" <zero@none0.it>
Newsgroups: free.it.visual-basic
References: <VqP6h.9067$mZ5.239@tornado.fastwebnet.it>
Subject: Re: Ciclo 'For each file in.....'
Date: Thu, 16 Nov 2006 12:57:08 +0100
MIME-Version: 1.0
Content-Type: text/plain;
 charset="Windows-1252"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Lines: 42
Message-ID: <455c525a$0$7637$4fafbaef@reader1.news.tin.it>
Organization: TIN.IT (http://www.tin.it)
X-Comments: Please send technical notifications to newsmaster@tin.it
NNTP-Posting-Host: 82.50.196.150
X-Trace: 1163678299 reader1.news.tin.it 7637 82.50.196.150:4860
X-Complaints-To: Please send abuse reports to abuse@tin.it