At the bottom of the AutoDoc, it says:
uint32 result = IDoMethodA(APTR obj, struct GP_TEXTEDITOR_ExportText* msg);
Isn't that kind of misleading/confusing? Should be APTR or STRPTR for result?
STRPTR Data;
if ((Data=(STRPTR)IIntuition->IDoMethod(ChildObjects[GAD_TEXTEDITOR],GM_TEXTEDITOR_ExportText,NULL)))
Several of them say uint32 for the result.
texteditor.gadget
texteditor.gadget
Workbench Explorer - A better way to browse drawers
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: texteditor.gadget
IDoMethod() returns a uint32 as result, whose meaning will change with context.
Cast as required, but the actual return value is stil unit32.
Cast as required, but the actual return value is stil unit32.
Re: texteditor.gadget
Since the SYNOPSIS is meant to demonstrate the use of a specific method, it would be clearer if the type casting were included in the SYNOPSIS for each method. As it stands, someone like me would attempt to use the function as shown in the SYNOPSIS and get a compile error before realizing some type casting was needed.broadblues wrote:IDoMethod() returns a uint32 as result, whose meaning will change with context.
Cast as required, but the actual return value is stil unit32.
AmigaOne X1000 with 2GB memory - OS4.1 FE
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: texteditor.gadget
The synopsis doesn't demonstrate how to use the function though, if it did it would not contain the types of the various a parameters.
It describes the types of the functions arguments and return type, and so must be accurate.
Whther it needs a 'cast' would depend on the language you ultimately used to program it. (and what options).
A cast *should* be present in an C based example code though.
It describes the types of the functions arguments and return type, and so must be accurate.
Whther it needs a 'cast' would depend on the language you ultimately used to program it. (and what options).
A cast *should* be present in an C based example code though.