SetDate
-
Function SetDate(ByVal nYear As Long, ByVal nMonth As Long, ByVal nDay As Long, ByVal nHour As Long, ByVal nMinute As Long, ByVal nSecond As Long) As Date
Dim dTemp2 As New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
Return dTemp2
End Functionreally? This is probably one of the best things this guy has done so far. I was advised not to put his code on this forum though. This one I just couldn't help.
If it moves, compile it
-
Function SetDate(ByVal nYear As Long, ByVal nMonth As Long, ByVal nDay As Long, ByVal nHour As Long, ByVal nMinute As Long, ByVal nSecond As Long) As Date
Dim dTemp2 As New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
Return dTemp2
End Functionreally? This is probably one of the best things this guy has done so far. I was advised not to put his code on this forum though. This one I just couldn't help.
If it moves, compile it
Issues I found: 1. It doesn't even set anything 2. It uses Long (Int64) while the constructor takes Integer (Int32) 3. Declares a temporary variable to be returned the next line 4. Why is it dTemp_2_? My way (I will keep the same name, mainly because I can't think of any other):
Function SetDate(ByVal nYear As Int32, ByVal nMonth As Int32, ByVal nDay As Int32, ByVal nHour As Int32, ByVal nMinute As Int32, ByVal nSecond As Int32) As Date
Return New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
End FunctionAll of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
Issues I found: 1. It doesn't even set anything 2. It uses Long (Int64) while the constructor takes Integer (Int32) 3. Declares a temporary variable to be returned the next line 4. Why is it dTemp_2_? My way (I will keep the same name, mainly because I can't think of any other):
Function SetDate(ByVal nYear As Int32, ByVal nMonth As Int32, ByVal nDay As Int32, ByVal nHour As Int32, ByVal nMinute As Int32, ByVal nSecond As Int32) As Date
Return New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
End FunctionAll of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
His calls to this function are to set a date variable = function call. He literally used this function for nothing. My solution was :
myVariableName = new Date(..yada..yada..yada...)
Zac Greve wrote:
It uses Long
Every numeric variable he declaired in the entire project was a long.
If it moves, compile it
-
His calls to this function are to set a date variable = function call. He literally used this function for nothing. My solution was :
myVariableName = new Date(..yada..yada..yada...)
Zac Greve wrote:
It uses Long
Every numeric variable he declaired in the entire project was a long.
If it moves, compile it
-
His calls to this function are to set a date variable = function call. He literally used this function for nothing. My solution was :
myVariableName = new Date(..yada..yada..yada...)
Zac Greve wrote:
It uses Long
Every numeric variable he declaired in the entire project was a long.
If it moves, compile it
Well, at least he wasn't stringing you along. GROAN!
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
GibbleCH wrote:
*shudder*
Shiver, shake, and convulse!
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
Well, at least he wasn't stringing you along. GROAN!
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
It seems to me that you are turning regular expressions into puns for amusement.
If it moves, compile it
I am just trying to move this thread along, but it seems that it is not synchronizing.
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
Function SetDate(ByVal nYear As Long, ByVal nMonth As Long, ByVal nDay As Long, ByVal nHour As Long, ByVal nMinute As Long, ByVal nSecond As Long) As Date
Dim dTemp2 As New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
Return dTemp2
End Functionreally? This is probably one of the best things this guy has done so far. I was advised not to put his code on this forum though. This one I just couldn't help.
If it moves, compile it
It's obvious this guy added the SetDate implementation to a class that implements the IDateRepository in order to facilitate dependency injection and the factory pattern! All the better I say. Should minimize the impact of the Y3K bug and enable unit testing of date functionality against realistic data.
-
I am just trying to move this thread along, but it seems that it is not synchronizing.
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value. Carl Sagan
-
Function SetDate(ByVal nYear As Long, ByVal nMonth As Long, ByVal nDay As Long, ByVal nHour As Long, ByVal nMinute As Long, ByVal nSecond As Long) As Date
Dim dTemp2 As New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
Return dTemp2
End Functionreally? This is probably one of the best things this guy has done so far. I was advised not to put his code on this forum though. This one I just couldn't help.
If it moves, compile it
Let me guess: that guy used to work with VB6, and now he ports many "useful" functions from his year-long experience to VB.NET.
-
Let me guess: that guy used to work with VB6, and now he ports many "useful" functions from his year-long experience to VB.NET.
-
Yes. He fought using .net in the first place, would not attempt to learn c#, and forces everything to work as if it were still vb6.
If it moves, compile it
Fire him! No Luddites allowed!!!
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me