|
ds_GetObjectComments |
|---|
| ds_GetObjectComments (selector; id; fieldID; comment {; commentStyle}) <- errorCode | |||
|---|---|---|---|
| Parameter | Type | Description | |
| -> | selector | Integer | selector |
| -> | ID | Integer | Object ID |
| -> | FieldID | Integer | Field number |
| <- | Comment | Text | Comment |
| <- | commentStyle | BLOB | Style of the comment |
| <- | errorCode | Long Integer | Error Code (0 = no error, -5 if object has no comment) |
Returns the object comment. It is a global comment, writen in Insider or 4D. If the object does not have a comment, -5 will be returned as the Error Code
| Selector values | |
|---|---|
| kds_DataBaseComment | 0 |
| kds_GroupComment | 1 |
| kds_ObjectComment | 2 |
| kds_TableComment | 3 |
| kds_FieldComment | 4 |
| kds_FormComment | 5 |
| kds_MenuBarComment | 6 |
| kds_MenuComment | 7 |
The ID expected is the one returned by other routines of the plugin such as ds_GetMethodNames, ds_GetFormNames, ds_TableIDs, ... To get a field comment, you must pass the table ID (not the table number) and the field number.
New in version 1.1 : blobStyl
If blobStyl is passed, it will be filled with the style description of the comment. This is available only if the comment has been written in the Explorer of 4D, not if it has been writtent with 4D Insider. The blob contains a description of the style in the "styl" Macintosh format. Note that this format can be used with 4D Write under Windows. So, usually, the developer will load the comment, put text and style in the clipboard and paste it in a 4D Wriite area:
| Sample Code |
|---|
| C_BLOB($styl) |
| SET BLOB SIZE($styl;0) |
| $comment:=" " |
| $L_err:=ds_GetObjectComment (kds_ObjectComment ;methodID;0;$comment;$styl) |
| CLEAR CLIPBOARD |
| SET TEXT TO CLIPBOARD($comment) |
| APPEND TO CLIPBOARD("styl ";$styl) |
| `the clipboard can now be pasted in a 4D Write area, under Mac and Windows. |