Description
Inserts a date type form field at the current text input position in a RichTextEdit control. A date field shows a date in its edit field. After a date field is inserted, if a user clicks at the date, a date-picking control will display for selecting a different date.
Applies to
Syntax
rtename.FormDateFieldInsert(date fieldDate, boolean showDateControl{ {,string format} {,integer emptyWidth}})
Argument |
Description |
---|---|
fieldDate |
The date to display in the edit field. The user can changed this date through a date picking control. When this parameter does not contain a date, the new date field is empty. |
showDateControl |
Specifies whether the date picking control is immediately shown after insertion. |
format | The format for displaying the date. When this parameter is omitted a default format is used depending on the language set for the date field's text. |
emptyWidth | The combobox's width, in twips, when its edit field is empty. If this parameter is omitted, a default width of 2000 twips is used. For almost all units of measurement in the RichTextEdit control, twips are used. Twip is a fabricated word meaning twentieth of a point (pt). |
Return value
Integer.
Returns a value greater than 0 if it succeeds and this value represents the unique ID of the form field that was successfully inserted. If any argument's value is null, returns null. Returns -1 if an error occurs. Returns -2 if the date value is invalid.
Examples
This example inserts a date form field which shows 1900-01-01 in the edit field, and when the field is inserted, the date picking control is immediately shown.
integer li_rtn li_rtn = rte_1.FormDateFieldInsert(1900-01-01, true)
This example inserts a date form field with the specified date, format, and emptyWidth.
integer li_rtn date ld_date string ls_format ld_date = today() ls_format = "yyyy-MM-dd" li_rtn = rte_1.FormDateFieldInsert(ld_date,false,ls_format,1500)