On Aug 12, 2006, at 4:30 PM, Robert Poland wrote:
On Aug 12, 2006, at 12:21 PM, Charles Yeomans wrote:
On Aug 12, 2006, at 2:03 PM, Robert Poland wrote:
Hi,
This function gives weird results. Is there something obvious
that I have done wrong? The results are shown in the comments.
// PeriodEnding.text is 8/12/06
Dim date1, date2, date3, date4, date5, date6, date7 As New Date
This line sets all of the variables to the same value. Instead write
dim date1 as new Date
dim date2 as new Date
etc.
Charles Yeomans
Thanks Charles, Terry,
So, reading between the lines concatenating Dim's only works with
variables?
Don't read between the lines; read the documentation :|
And "New Date" is not a variable but an object used like a variable???
"New" is an operator that creates an instance of the class whose name
is passed to it -- in this case, Date. It returns a reference to the
object, not the object itself, and this reference is assigned to the
variable or other assignment target.
dim d as new Date
is really a bit of shorthand for
dim d as Date = new Date
which in turn is a contracted form of
dim d as Date
d = new Date.
You might find <http://www.declaresub.com/Articles/
ObjectReferences.html> of use.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>