Alter this short date by a number of months into future/past. The changed value will not be assumed if it amounts to an out of range date.

Return TypeFunction nameArguments
hzEcodehzSDate::AltMonth(int32_t,)

Declared in file: hzDate.h
Defined in file : hzDate.cpp

Function Logic:

0:START 1:unknown 2:Return E_OK 3:items Y ( months months 4:unknown 5:Return E_RANGE 6:months 7:Y months M 8:Return _daysfromdate(m_days,Y,M,D)

Function body:

hzEcode hzSDate::AltMonth (int32_t interval)
{
   //  Alter this short date by a number of months into future/past. The changed value will not be assumed if it amounts to an out of range
   //  date.
   //  
   //  Arguments: 1) interval Number of months into future/past
   //  
   //  Returns: E_RANGE If the supplied interval rendered this date invalid
   //     E_OK If the supplied interval was applied
   uint32_t    Y ;         //  Year part
   uint32_t    M ;         //  Month part
   uint32_t    D ;         //  Day part
   int32_t     months ;    //  Total months
   if (!interval)
       return E_OK ;
   _datefromdays(Y, M, D, m_days) ;
   months = (Y * 12)+M ;
   months += interval ;
   if (months < 0|| months >&eq; 120000)
       return E_RANGE ;
   Y = months / 12;
   M = months % 12;
   return _daysfromdate(m_days, Y, M, D) ;
}