version 6.0
DR SET FORMAT (area; scope; format)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -3 = Selected characters | |
| -1 = All, | |||
| 0 = Selected | |||
| >0 = Object ID | |||
| format | String | Format of reference |
Description
The command DR SET FORMAT makes format the display format for references in area described by scope.
If scope equals -3, DR SET FORMAT formats any references in the highlighted text of the selected object.
If scope equals -1, the command formats all references in the document.
If scope equals 0, the command formats all references in the selected objects.
If scope is greater than 0, it must be equal to a specific text object's ID; the command formats all references in that object. If the object does not exist, DR SET FORMAT does nothing, and DR Error returns error number 2.
If scope does not contain a reference, DR SET FORMAT does nothing.
format is the display format for the reference. It is the procedural equivalent of choosing a format from the format dialog box. Formats are referred to either by number or by name: they are numbered in the order in which they appear in the list of the Format dialog box.
If format is a one or two digit string, then the format applied is from the list. If format is not a one or two-digit string, then it is compared against the text values of each format in the list. If it matches one of the values in the list, that format is applied. This means that you can refer to the first date format as either "19" or "Short".
If format is not in the list of formats it is interpreted as a custom numeric format. If format is inappropriate for the resulting value of the reference, it is ignored. For instance, if you use a date format on a number, the number appears unformatted.
Example
The following example inserts the text "Current date", replacing the currently highlighted text of the selected text object. It then uses the DR DO COMMAND to turn it into a reference and applies the date format "Long".
DR SET TEXT (Area;-3;"Current date") DR DO COMMAND (Area;7003) DR SET FORMAT (Area;-3;"Long")
See Also