ve been attempting to get my head around VBScript with and working with dates. At the point of "computer go by by out of the window" decided to use a DCOM component to get my results.
Have created it and tested it.
I am familiar with database recordsets using VBSCRIPT but not getting two variables out of my function every time it loops around. The two variables are StartOfMonthOutput and MonthOutput. The function is shown below. Does anyone know how to get these two variables out of the DCOM as the program loops around.
Function Test(MonthsBack As Integer)
Dim counter As Integer
Dim PresentMonth As Integer
Dim DateWorkingWith As Date
DateWorkingWith = Date
Dim MonthOutput As Variant
Dim StartOfMonthOutput As Date
PresentMonth = Format(Date, "M"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
counter = PresentMonth - MonthsBack
Do While counter <> PresentMonth
StartOfMonthOutput = DateSerial(Year(DateWorkingWith), Month(DateWorkingWith), 1)
MonthOutput = Format(StartOfMonthOutput, "MMMM"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
DateWorkingWith = DateAdd("M", -1, DateWorkingWith)
counter = counter + 1
Loop
End Function
Have created it and tested it.
I am familiar with database recordsets using VBSCRIPT but not getting two variables out of my function every time it loops around. The two variables are StartOfMonthOutput and MonthOutput. The function is shown below. Does anyone know how to get these two variables out of the DCOM as the program loops around.
Function Test(MonthsBack As Integer)
Dim counter As Integer
Dim PresentMonth As Integer
Dim DateWorkingWith As Date
DateWorkingWith = Date
Dim MonthOutput As Variant
Dim StartOfMonthOutput As Date
PresentMonth = Format(Date, "M"
counter = PresentMonth - MonthsBack
Do While counter <> PresentMonth
StartOfMonthOutput = DateSerial(Year(DateWorkingWith), Month(DateWorkingWith), 1)
MonthOutput = Format(StartOfMonthOutput, "MMMM"
DateWorkingWith = DateAdd("M", -1, DateWorkingWith)
counter = counter + 1
Loop
End Function