Added a new module called Calender

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Added a new module called Calender

Post by TimB » Sun Oct 15, 2006 4:47 pm

Just to say I added a new module called Calender on the wiki

Tim

User avatar
_Gabi_
Registered User
Registered User
Posts: 6
Joined: Tue Oct 10, 2006 9:31 pm
Location: Braila, RO

Post by _Gabi_ » Sun Oct 15, 2006 5:49 pm

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 :

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
And while here, is there an example on how to use functions with a structure type return ?
Regards,

Gabi

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Sun Oct 15, 2006 6:28 pm

Tim,

Great! Thanks very much for sharing this library.

Steven

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Sun Oct 15, 2006 6:31 pm

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. :oops:

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.

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Sun Oct 15, 2006 6:55 pm

Ok Amended the module. That was a neat solution!

It shaved a good load off the compile total using the new code and swapping to a Boolean return.

Post Reply