// currently is January, to check last December

  IF MonthOf (a Date) = 1  the then // currently is January to December last year, check 
    the Y-: = - 1 // To show last year, 
  the else 
    the Y-: = 0 ;
   for the I: = 12  downto  1  do 
    cmbMonth.Items.Add (the Format ( ' % D - 2D%. ' , [YearOf (a Date) + the Y, the I])); 

  IF the Y = 0  the then 
    cmbMonth.ItemIndex: = cmbMonth.Items.IndexOf (the Format ( ' % D -% 2D. ' , [YearOf (a Date), MonthOf (a Date) - . 1 ])) // currently February to December, January to November of this year to check
   the else 
    cmbMonth.ItemIndex:CmbMonth.Items.IndexOf = (the Format ( ' .% D -% 2D ' , [YearOf (a Date) - . 1 , 12 is ])); // currently January December check

 

Guess you like

Origin www.cnblogs.com/CodeGear/p/11861077.html