Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different Approach to the same code
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Different Approach to the same code
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01514654
Message ID:
01514654
Views:
125
Hi all:

Im code reviewing a program and in a vb class I see some code that I believe can be enhance. I dont think that VB does not have other option to make the same thing more efficient. Here is the problem

The programmer has to create 366 variables this way
Private decPeriodDay1 As Decimal = Nothing
    Private decPeriodDay2 As Decimal = Nothing
    Private decPeriodDay3 As Decimal = Nothing
.....

 Private decPeriodDay363 As Decimal = Nothing
    Private decPeriodDay364 As Decimal = Nothing
    Private decPeriodDay365 As Decimal = Nothing
    Private decPeriodDay366 As Decimal = Nothing
and then declare a property 366 times.
Public Property PeriodDay1() As Decimal
        Get
            Return decPeriodDay1
        End Get
        Set(ByVal value As Decimal)
            decPeriodDay1 = value
        End Set
    End Property

.....

 Public Property PeriodDay366() As Decimal
        Get
            Return decPeriodDay366
        End Get
        Set(ByVal value As Decimal)
            decPeriodDay366 = value
        End Set
    End Property
All this information in a class. If somebody know a better approach I will apreaciate.
Gregorio J. Placeres
IT Analyst
Uniform Accounting Network
Auditor of State of Ohio
88 East Broad Street
P.O. Box 1140
Columbus, Ohio 43216-1140

Tel. 614-728-4694

Gregorio_J@MSN.COM

http://www.gjpproductions.com
Next
Reply
Map
View

Click here to load this message in the networking platform