67. Signing Date
Description
A flexible signing (acknowledgment) date computation that either accepts and formats a date provided by the user, or creates a "fill-in-the-blank" type date where any piece of information can be supplied and the others left as "fill-in-the-blank" areas.
Code
""
// Specified date (must be answered)
IF SigningDate-m = "Select a date"
ASK SigningDate-d
IF ANSWERED( SigningDate-d )
"«SigningDate-d:6th day of June, 1990»"
ELSE
SET SigningDate-m TO "Fill-in-the-blank"
END IF
END IF
// TODAY
IF SigningDate-m = "Today"
"«TODAY:6th day of June, 1990»"
// This month
ELSE IF SigningDate-m = "This month"
"_____ day of «TODAY:June», «TODAY:1990»"
// Next month
ELSE IF SigningDate-m = "Next month"
"_____ day of «TODAY + 1 MONTH:June»"
RESULT + ," «TODAY + 1 MONTH:1990»"
END IF
// Fill-in-the-blank (the fall-back)
IF RESULT = ""
"_____ day of ________________, 20____"
END IF
Explanation
This text computation variable returns a signing (acknowledgment) date that is either (1) today's date, (2) a selected date, (3) the current month and year with the date left blank, (4) next month and year with the date left blank, or (5) a fill-in-the-blank date (day, month and year are all left blank).
The computation relies on a multiple choice variable, SigningDate-m, which has as its options "Today," "Select a date," "This month," "Next month," and "Fill-in-the-blank." The variable should be set to "Select One Only," and "Other" should not be marked.
The computation also requires a date variable, SigningDate-d. Since this variable might not get answered, it should be set to "Don't warn if unanswered" in the Advanced options.
Based on the user's response to SigningDate-m, the computation will either return today's date or a user-selected date as "6th day of June, 1990," or will return either this or next month with the date left blank, like this: "_____ day of June, 1990." (It will automatically select the appropriate month and year.) Otherwise, it will default to "_____ day of ________________, 20____."
You should place this computation where you want the signing date to appear, rather than using SigningDate-d or SigningDate-m. Note that the computation returns a text value, not a date value.