DOW - Happy Birthday, Merry Christmas, When?
#2
Good - the functions could be shortened:

Code: (Select All)
For i = 1 To 12
  Print StringMonth$(i) + "|",
  Print StringMonthB$(i) + "|"
Next i

Function StringMonthB$ (MonthCode%)
  Dim Table$
  Table$ = Table$ + "January  February March    April    May      June     "
  Table$ = Table$ + "July     August   SeptemberOctober  November December "
  StringMonthB$ = _Trim$(Mid$(Table$, MonthCode% * 9 - 8, 9))
End Function

Function StringMonth$ (MonthCode%)
  Dim MonthString$
  Select Case MonthCode%
    Case 1
      MonthString$ = "January"
    Case 2
      MonthString$ = "February"
    Case 3
      MonthString$ = "March"
    Case 4
      MonthString$ = "April"
    Case 5
      MonthString$ = "May"
    Case 6
      MonthString$ = "June"
    Case 7
      MonthString$ = "July"
    Case 8
      MonthString$ = "August"
    Case 9
      MonthString$ = "September"
    Case 10
      MonthString$ = "October"
    Case 11
      MonthString$ = "November"
    Case 12
      MonthString$ = "December"
  End Select
  StringMonth$ = MonthString$
End Function
___________________________________________________________________________________
I am mostly grateful for the people who came before me.  Will the people after me be grateful for me?
Reply


Messages In This Thread
RE: DOW - Happy Birthday, Merry Christmas, When? - by dcromley - 05-24-2022, 01:33 PM



Users browsing this thread: 2 Guest(s)