On Error Goto Hell
your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 4 of 4 Thread: On Error Goto Hell Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Oct 13th, 2001,09:00 PM #1 747 Guest On Error Goto Hell On Error GoTo ErrHandler I have this under every command button on my form, but I think there is another way of doing this please advise Reply With Quote Oct 13th, 2001,09:02 PM #2 agent View Profile View Forum Posts Fanatic Member Join Date Jun 1999 Location California, USA Posts 662 nope. not in any version of vb before vb.net. Reply With Quote Oct 13th, 2001,09:06 PM #3 beachbum View Profile View Forum Posts Visit Homepage PowerPoster Join Date Jul 2001 Location Wollongong, NSW, Australia Posts 2,274 If nothing critical is happening in ur routines u can just use On Error Resume Next. Saves adding the handler to each sub. Regards Stuart Stuart Laidlaw Brightspark Financial Software http://www.gstsmartbook.com Reply With Quote Oct 13th, 2001,09:21 PM #4 DaoK Guest I never use On Error Resume Next until I have solved all problem. WHen I see than I am ready to make it EXE than I put it in all function and command to be sure to don't have any error if user try it on their PC. Reply With Quote Quick Navigation Visual Basic 6 and Earlier Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual Basic Visual Basic .NET VB.net CodeBank Visual Basic 6 and Earlier CodeBank - Visual Basic 6 and earlier Modern Windows Experience (Metro) Office Development Mobile Development ASP, VB Script Database Development Reporting API Games and Graphics Programming Game Demos COM and ActiveX Network Programming Visual Basic FAQs Slow Chat with the Microsoft Visual Basic team .NET ASP.NET Visual Basic .NET MVC .Net C# WPF, WCF, WF Silverlight .NET Architecture and Design General General Developer Forum IoT, IoE, and Maker Forum Testers and Testing Application Testing Application Deployment Linux Development General PC VBForums Coding Contests Contest Entries Code It Better Maths Forum Other Languages Other BASIC C and C++ Java PHP XML, HTML, Javascript, Web and CSS jQuery Assembly Other Programming Languages VBForums Code
Knowledge Base > Tutors' Corner > On Error Goto Hell Thread Tools Display Modes #1 01-23-2002, 06:27 AM Flyguy Lost Soul Super Moderator* Guru * Join Date: May 2001 Location: Vorlon Posts: 19,124 On Error Goto Hell An essay about handling Errors in Visual Basic. Written by Peter J. Morris Attached Files essayonerrorgotohell.zip (936.2 KB, 2015 views) Flyguy View Public Profile Find all posts by Flyguy « Previous Thread | Next Thread » Currently Active Users Viewing This Thread: 1 (0 members and http://www.vbforums.com/showthread.php?110745-On-Error-Goto-Hell 1 guests) Thread Tools Show Printable Version Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules Forum Jump User Control Panel Private Messages http://www.xtremevbtalk.com/tutors-corner/16987-error-goto-hell.html Subscriptions Who's Online Search Forums Forums Home News & Notifications Announcements .Net News & Articles Visual Basic .NET (2002-2015), including Express editions) .NET Knowledge Base Tutors' Corner Code Library ASP.Net .NET Communications .NET Game Programming Managed DirectX .NET Office Automation .NET File I/O and Registry .NET Database and Reporting .NET Interface and Graphics .NET Installation / Documentation .NET General Xtreme .NET Talk Legacy Visual Basic (VB 4/5/6) Knowledge Base Tutors' Corner Code Library Communications Game Programming DirectX VBA / Office Integration Excel Word, PowerPoint, Outlook, and Other Office Products API File I/O and Registry Database and Reporting Interface and Graphics Installation / Documentation General Other Languages Web Programming Miscellaneous Languages General Discussion Member Offers and Deals
On Error GoTo Hell DownloadForm.DownloadFile " http://www.*-*-*.com/ ategoryID=5&mode=download&path=&fname=Amsterdam%2Ezip", _ "e:\StandingData\Amsterdam\Amsterdam.zip" launchBat = Shell("E:\StandingData\SD.bat", 1) Exit Sub http://computer-programming-forum.com/71-visual-basic-vb/0ddde3a531ec1b11.htm Hell: Open App.Path & "\error.log" For Append As #1 http://diskusiweb.com/discussion/12067/on-error-goto-hell/p1 Print #1, Err.Number & " - " & Error$ Close #1 End End Sub ______________________________________________________ In the vb-development environment it works fine to download this file....BUT when I'm make an exe and execute it my errorhandler breakes in and tells me that "Can't find file..." How can I succeed on error downloading a file from VB and NOT when I make an exe from the project...???? Is it a newbie thing or is it something else??? Thanks in advance... Best regards, Mike Eff. Tue, 28 Jan 2003 03:00:00 GMT Bill McCarth#2 / 4 On Error GoTo Hell Have you set your error trapping options to "Break in Class Module" ? Quote:> Hello all VB-gurus... > ____________________________________________________ > Sub Main() > on error goto Dim launchBat > On Error GoTo Hell > DownloadForm.DownloadFile "http://support.xxxxx.co.uk/supportArea/ProductDownload.asp?ProductID=... Quote:> ategoryID=5&mode=download&path=&fname=Amsterdam%2Ezip", _ > "e:\StandingData\Amsterdam\Amsterdam.zip" > launchBat = Shell("E:\StandingData\SD.bat", 1) > Exit Sub > Hell: > Open App.Path & "\error.log" For Append As #1 > Print #1, Err.Number & " - " & Error$ > Close #1 > End > End Sub > ______________________________________________________ > In the vb-development environment it works fine to download this file....BUT > when I'm make an exe and execute it my errorhandler breakes in and tells me > that "Can't find file..." > How can I succeed downloading a file from VB and NOT when I make an exe from > the project...???? > Is it a newbie thing or is it something else??? > Thanks in advance... > Best regards, > Mike Eff. Tue, 28 Jan 2003 03:00:00 GMT Cowbo#3 / 4 On Error GoTo Hell Quote:>Hello all VB-gurus... >____________________________________________________ >Sub Main() > Dim launchBat > On Error GoTo Hell > DownloadForm.DownloadFile >"http://support.xxxxx.co.uk/supportArea/ProductDownload.asp?ProductID=... >ategoryID=5&mode=download&path=&fname=Amsterdam%2Ezip", _ > "e:\StandingData\Amsterdam\Amsterda
program di posting Anda, tolong ikuti aturan yang sesuai, baca http://diskusiweb.com/discussion/39204/aturan-cara-menyisipkan-kode-program-di-diskusiweb Baca cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1Maaf bagi yang tidak bisa mendaftar atau ingin mereset password pada 25 Maret sampai pagi ini karena ada error, sekarang sudah bisa berfungsi. Kalau email konfirmasi tidak masuk-masuk, tolong cek folder Spam di email Anda. Diskusi Pemrograman & IT On Error GoTo Hell Husni November 2005 Posts: 3,244 Gimana caranya menangani 2 error yang terjadi dalam suatu prosedur? [code] Private Sub Command1_Click() On Error GoTo Hell Kill "C:\Windows\Kamu.txt" Exit Sub Hell: Kill "C:\Windows\Aku.txt" End Sub [/code] Jika file aku.txt dan kamu.txt tidak ada, maka program akan error. Gimana biar tidak error? Thanks. apri November 2005 Posts: 25 Bagaimana kalau dalam prosedur disisipkan dulu perintah untuk mencari file yang akan di Kill.jika file nya ada lakukan prosedur berikutnyaJika tidak ada munculkan pesan file tidak ada...atau... sisipkan juga perintah untuk membuat file dulu di direktori tempat penyimpanan filenah .. filenya pasti selalu ada.atau On error resume next atau ... he..he...PR dah... coba dulu :)Thanks Husni... berhasil memacing kita berfikir lagi.. Husni November 2005 Posts: 3,244 Makasih atas jawabannya, namun maaf mas, yang saya maksud adalah gimana cara menangani 2 error yang terjadi berturut turut.Error yang terjadi tidak bisa dielakkan lagi, misalnya error karena user tidak ada hak akses thd suatu file. Sehingga akan mengakibatkan File/Path Access Error.Tidak boleh pake On Error Resume NextAda yang bisa bantu? dexno November 2005 Posts: 40 Kalo di tampilkan pesan errornya gimana?misalnya pake messagebox pada fungsi "err" :)Jadi klo ada error, setidaknya program tidak usah mati tiba2, masih bisa di lanjutkan, dan pesan error yang bikin program mati tiba2 itu di tampilkan ke layar. Habis itu nothing happen koq. nundee November 2005 Posts: 875 kasus husni di atas sebenernya bukan mencari jawaban mengenai cara menghentikan/menyembunyikan pesan kesalahan, tapi kasus nya lebih menarik lagi."Apakah bisa di dalam suatu prosedur memiliki banyak rujukan penanganan error bahkan mungkin penanganan error bersarang?"gitu ya husni? nundee November 2005 Posts: 875 sampai dengan se