Domino Code Fragment

Code Name*
Get the Next Month
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.129.211.87
Description*
The following routine will determine what the next month is following the month curently being displayed. If the next month is January, then the routine will increment the year by one.
Type*
Formula
Categories*
Date/Time Handling
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
REM "Build string of month numbers and month names";
M_DEX := "01" : "02" : "03" : "04" : "05" : "06" : "07" : "08" : "09" : "10" : "11" : "12";
M_MENU := @UpperCase("January" : "February" : "March" : "April" : "May" : "June" : "July" : "August" : "September" : "October" : "November" : "December");


REM "Convert Month field from text to number";
mth := @Replace(@Text(Month); m_menu ; @Text(@TextToNumber(M_DEX)));


REM "Add one to numeric month field.";
REM "If new value is 13 then set to 01";
NU_MONTH := @Replace(@Right("0" + @Text((@TextToNumber(mth) + 1)); 2); "13"; "01");
NU_YEAR := @Text(@TextToNumber(Year) + (NU_MONTH = "01"));


REM "Get new Month text value";
x := @Replace(@Text(nu_month); @Text((M_DEX)); M_MENU);


REM "Update the month and year fields in the current form";
FIELD Month := x;
FIELD Year := Nu_Year;


REM "Force the current form to be refreshed";
@Command([ViewRefreshFields])