SetValue

Description

Sets the date and time in the Value property of the control.

Applies to

DatePicker control

Syntax

controlname.SetValue ( d, t )
controlname.SetValue ( dt )

Argument

Description

controlname

The name of the control for which you want to set the date and time

d

The date value to be set in the Value property

t

The time value to be set in the Value property

dt

The DateTime value to be set in the Value property


Return value

Integer.

Returns 1 for success and one of the following negative values for failure:

-1 -- The value cannot be set

-2 -- Other error

Usage

The SetValue function can set the Value property using separate date and time variables or a single DateTime variable.

Examples

This example sets the Value property of a DatePicker control using separate date and time values:

date d
time t
d=date("2007/12/27")
t=time("12:00:00")
dp_1.SetValue(d, t)

This example sets the Value property using a DateTime value:

date d
time t
datetime dt
dt = DateTime(d, t)
dp_1.SetValue(dt)

See also

GetText

GetValue