Just to say I added a new module called Calender on the wiki
Tim
Added a new module called Calender
Moderators: David Barker, Jerry Messina
Hi Tim,
nice useful one
while working on a SNTP Unix to DateTime routine, just about same, this is how I check for leap years :
And while here, is there an example on how to use functions with a structure type return ?
nice useful one
while working on a SNTP Unix to DateTime routine, just about same, this is how I check for leap years :
Code: Select all
// Check Leap
Public Function CheckLeap(PYear As Word) As Boolean
If (PYear And $03) = 0 Then
Result = true // its a LEAP Year
Exit
EndIf
Result = false
End Function
Regards,
Gabi
Gabi
Hi Gabi
Neat!
I will amend the module later. I have to say that function caused me a load of trouble, as I failed to initialize the return var. Sorry Dave even thinking there might have been an issue elsewhere than in my code.
The one I posted is a little different in that I return a 1 or 0 (byte value) as its used to add to a total in another function in the module. But I will modify all every thing to suit a Boolean return.
Neat!
I will amend the module later. I have to say that function caused me a load of trouble, as I failed to initialize the return var. Sorry Dave even thinking there might have been an issue elsewhere than in my code.
The one I posted is a little different in that I return a 1 or 0 (byte value) as its used to add to a total in another function in the module. But I will modify all every thing to suit a Boolean return.