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
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:
01514656
Views:
49
Use an array or a collection...

HTH

thomas
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform