Hi Robert.

Your first dim statement is not nice.
I'm not sure exactly what you are trying to accomplish, but you really need 7 dim statements here, to ensure that you get 7 separate instances of the date, because that's how you are using them later on.

There may be another way to force it in one statement, but it's messy, and maintenance programmers would be after your hide.

Once you have the 7 separate instances, you'll have to initialize them properly as well, with reference to PeriodEnding, as you did with date7.

All the best.

Russ

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
  Dim d As New date()
  Dim b As boolean
  b=parsedate(PeriodEnding.text,d) // get date from PeriodEnding

  date1=d
  date7.TotalSeconds=date1.TotalSeconds

  date6.Day=date7.Day-1
  date5.Day=date7.Day-2
  date4.Day=date7.Day-3
  date3.Day=date7.Day-4
  date2.Day=date7.Day-5
  date1.Day=date7.Day-6

  Sat1.text=date7.shortdate // 7/28/06
  Fri1.text=date6.shortdate // 7/28/06
  Thu1.text=date5.shortdate // 7/28/06
  Wed1.text=date4.shortdate // 7/28/06
  Tue1.text=date3.shortdate // 7/28/06
  Mon1.text=date2.shortdate // 7/28/06
  Sun1.text=date1.shortdate // 8/22/06

Tia,

Robert Poland
[EMAIL PROTECTED]



_______________________________________________
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>

_______________________________________________
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>

Reply via email to