SetToday PowerScript function
Description
Sets the value that is used by the calendar as today’s
date.
Controls
DatePicker, MonthCalendar controls
Syntax
|
1 |
<span>controlname</span>.<span>SetToday </span>( <span>d</span><span></span> ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the control for which you |
|
d |
The date you want to specify as the Today |
Return Values
Integer. Returns 0 for success and -1
for failure.
Usage
By default, the current system date is set as the Today date.
You can use the SetToday function to specify
a different date. If the date is set to any date other than the
current system date, the following restrictions apply:
-
The control does not automatically update the Today selection
when the time passes midnight for the current day. -
The control does not automatically update its display
based on locale changes.
Examples
This example gets a date from an EditMask control
and sets it as the Today date in a MonthCalendar control:
|
1 |
Date currentdate |
|
1 |
integer li_return |
|
1 |
<br>currentdate = Date(em_1.Text) |
|
1 |
li_return = mc_1.SetToday(currentdate) |