Article View: free.it.visual-basic
Article #2833Re: Divisione per zero
From: Alan1
Date: Sat, 01 Feb 2003 13:56
Date: Sat, 01 Feb 2003 13:56
37 lines
2046 bytes
2046 bytes
"alberto" <c-appe@libero.it> ha scritto nel messaggio news:5Ai_9.66416$ZE.1803284@twister2.libero.it... > Private Sub divisione_sicura() > > On Error GoTo gestione_errori > > 'attivo la gestione degli errori > 'seplicemente faccio saltare l'esecuzione > 'alla etichetta gestione_errori > > a = 1 / 0 > '1/0 genera l'errore 11 (divisione per zero) > > MsgBox "Ok possiamo continuare", vbInformation, "Et voila'" > 'dopo aver avvisato dell'errore ricomincero' da questa riga > > on error goto 0 > 'disattivo il gestore degli errori > 'ora sono al sicuro > > Exit Sub > 'per saltare il gestore degli errori > > > gestione_errori: > If Err.Number = 11 Then > > MsgBox "Attento, non si puo' dividere per zero!!", > vbInformation, "EHI!" > Resume Next > 'riprendo l'esecuzione dalla riga successiva a quella che ha generato > errore. > End If Lo provo subito ti ringrazio per il listato ciao e di nuovo grazie. alan1
Technical Details
Message-ID:
<fmQ_9.156039$AA2.6333219@news2.tin.it>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mailReferences:
<HURZ9.135768$AA2.5625338@news2.tin.it> <5Ai_9.66416$ZE.1803284@twister2.libero.it>Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII-7-bit X-Google-Thread: f94ee,6d2af3dedcf3ae52 X-Google-Attributes: gidf94ee,public X-Google-ArrivalTime: 2003-02-01 05:56:32 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeeder.edisontel.com!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mail From: "Alan1" <renainn@tin.it> Newsgroups: free.it.visual-basic References: <HURZ9.135768$AA2.5625338@news2.tin.it> <5Ai_9.66416$ZE.1803284@twister2.libero.it> Subject: Re: Divisione per zero Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <fmQ_9.156039$AA2.6333219@news2.tin.it> Date: Sat, 01 Feb 2003 13:56:27 GMT NNTP-Posting-Host: 212.171.193.230 X-Complaints-To: newsmaster@tin.it X-Trace: news2.tin.it 1044107787 212.171.193.230 (Sat, 01 Feb 2003 14:56:27 MET) NNTP-Posting-Date: Sat, 01 Feb 2003 14:56:27 MET Organization: TIN