Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2003, 10:29 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Smart Error Traping

Hi there,
Does anybody know, when an error occured how can I get error source line?

-ned
__________________
-Ned
 
Old September 5th, 2003, 12:27 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ned,

You can get the source line with function Erl. You will need to add number to each line that execute code.

An example of how to use the Erl
Code:
Private Sub Form_Load()
     Dim iTest As Integer

     On Error GoTo CheckError

1    If iTest = 0 Then
2      iTest = Exp(320)
     End If

     Exit Sub

CheckError:

     Debug.Print "Number: " & Err.Number
     Debug.Print "Source: " & Err.Source
     Debug.Print "Description: " & Err.Description
     Debug.Print "Line: " & Erl
End Sub
Stéphane Lajoie
 
Old September 7th, 2003, 05:07 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Stéphane,
This is new to me, I rerally appreciate your response.
But my application is very big - around 20,000 lines.
I don't know how many days it will take me to write line
numbers in order to implement Erl.
We are planning to migrate our application to .NET. I am
wondering if there is any easy solution in .NET then I do not
have to bother otherwise I can start working on it.

-ned
 
Old September 7th, 2003, 08:05 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For inserting Line No ,Err Handler and Comments there is V.Good tool(Addin) avaliable at www.mztools.com
Really it is good.

Failure is not a Defeat it is just a Delay
 
Old September 11th, 2003, 05:01 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ned,

Erl still exists in .NET. In edition .NET supports a exception based error trapping system that has the ability to give back the actual call that failed. See http://msdn.microsoft.com/library/de...exceptions.asp
for more information.

Yehuda





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Smart Upload arabuafef Classic ASP Basics 0 December 24th, 2006 05:48 AM
dynamic smart tag Medes VS.NET 2002/2003 0 April 13th, 2006 12:59 PM
Smart navigation Baby_programmer ASP.NET 1.0 and 1.1 Basics 2 August 31st, 2004 06:28 AM
Smart Navigation in IE4 Ghost ASP.NET 1.x and 2.0 Application Design 1 July 25th, 2003 07:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.