Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Source code related resources

Moderator: Rathinagiri

Leopoldo Blancas
Posts: 344
Joined: Wed Nov 21, 2012 7:14 pm
Location: México
Has thanked: 1 time
Been thanked: 4 times

Re: Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Post by Leopoldo Blancas » Fri Mar 15, 2013 4:37 pm

Hola Checando mi rutina hay un error de dedo en:
*-----------------------------------------------------------
Checking my routine Hello there finger error:

Code: Select all

AADD(aMesesDias,{2,'FE[b]C[/b]BRERO',IIF(lBisiesto,29,28)})   // SOBRA LA "C"
Saludos
Polo
*----------------------------------------------
Regars
Polo

Leopoldo Blancas
Posts: 344
Joined: Wed Nov 21, 2012 7:14 pm
Location: México
Has thanked: 1 time
Been thanked: 4 times

Post by Leopoldo Blancas » Fri Mar 15, 2013 4:51 pm

Hola...

Para que este completa la rutina falta esta rutina mas:
*----------------------------------------------
Hello ...

For this complete lack this workout routine more:

Code: Select all

FUNCTION PosiArray(MiArray,cParam)
LOCAL n:= 0
LOCAL nPos := 0

   FOR n := 1 TO LEN(MiArray)
      IF ValType(cParam)== 'N'
         IF MiArray[n] == cParam
            nPos := n
         ENDIF
      ELSE
         IF UPPER(ALLTRIM(MiArray[n])) == UPPER(ALLTRIM(cParam))
            nPos := n
         ENDIF
      ENDIF
   NEXT n 

RETURN nPos
Saludos
Polo
*-------------------------
Regards
Polo

brunellopulix
Posts: 36
Joined: Sat Apr 24, 2010 10:17 am

Post by brunellopulix » Sun Mar 17, 2013 9:10 am

Hi all

From clipper 5.2 .\Source\Sample\Date.prg


/***
*
* DateIsLeap( <dDate> ) --> lLeap
*
* Determine if the year of a supplied date is a leap year
*
*/
FUNCTION DateIsleap( dDate )

LOCAL nYear := YEAR( dDate )

RETURN (( nYear % 4 ) == 0 ) .AND. ;
((( nYear % 100 ) != 0 ) .OR. ;
(( nYear % 400 ) == 0) )


Brunello

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 250 times
Been thanked: 91 times
Contact:

Post by esgici » Sun Mar 17, 2013 11:06 am

IsLeap( [<dDate>] ) -> lIsLeap // hbct
IsLeapYear( <dDate> ) --> lTrueOrFalse // hbmisc

http://www.elektrosoft.it/tutorials/Har ... htm#IsLeap
Viva INTERNATIONAL HMG :D

Post Reply