Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array of Month Days
Message
 
To
20/09/2002 17:45:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00702954
Message ID:
00702973
Views:
9
Try this setting ldDate for the date that you want to create the array for -
LOCAL ldDate, ldFirstDay, lnBeg, lnEnd, lnCount

ldDate = DATE()
ldFirstDay = CTOD(STR(MONTH(ldDate)) + "/01/" + STR(YEAR(ldDate)))
lnBeg = DOW(ldFirstDay)
lnEnd = lnBeg + DAY(GOMONTH(ldFirstDay, 1) - 1) - 1
DIMENSION laArray[lnEnd]

IF lnBeg > 1
  FOR lnCount = 1 TO lnBeg
    laArray[lnCount] = 0
  ENDFOR
ENDIF

FOR lnCount = lnBeg TO lnEnd
  laArray[lnCount] = lnCount - lnBeg + 1
ENDFOR
HTH

Dan

>I need to create an array of month days. I need the array to start with 1 and if the first day of the month is not a Sunday array(1) = 0 etc.. until the first day matches loop value then number rest of days sequencually.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform