Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing the code in class
Message
From
17/01/2005 07:08:55
 
 
To
17/01/2005 01:15:59
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
00977659
Message ID:
00977695
Views:
24
This message has been marked as the solution to the initial question of the thread.
Hi Michel.

Put the structure into one class and when you want to use it in a new class just use the inherits statement in the class declaration.

>In my framework DLL, I have several classes defined in several class files. In each file, I have this structure:
>
>
>Public Class MyName
>
>    Public Shared lError As Boolean = False
>    Public Shared cError As String = ""
>    Public Shared cErrorStackTrace As String = ""
>
>    ' My list of functions here
>
>    ' Initialize the default properties before the function gets called
>    Private Shared Sub ErrorInitialize()
>        lError = False
>        cError = ""
>        cErrorStackTrace = ""
>    End Sub
>
>    ' When an error occurs, we are setting up those properties
>    ' expO1 Exception object
>    Private Shared Sub ErrorSetup(ByVal toError As Exception)
>        cError = toError.Message
>        lError = True
>        cErrorStackTrace = toError.StackTrace
>    End Sub
>
>End Class
>
>
>In each file, I have definining those 3 public properties as well as those two functions. Wouldn't it be a way to only define that in one place?
Magnus Nordin
VFP MCP

"We have tested the GUI on 5-year olds. Why? Beacuse they aren't braindead!"
Michael Spindler, Apple

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform