texteditor.gadget

Have a question about our Software Developer Kit? Ask them here.

texteditor.gadget

Postby mritter0 » Fri Mar 30, 2018 3:14 am

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.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 210
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: texteditor.gadget

Postby broadblues » Fri Mar 30, 2018 6:12 pm

IDoMethod() returns a uint32 as result, whose meaning will change with context.

Cast as required, but the actual return value is stil unit32.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 532
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: texteditor.gadget

Postby xenic » Sat Mar 31, 2018 4:39 pm

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.

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.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1109
Joined: Sun Jun 19, 2011 1:06 am

Re: texteditor.gadget

Postby broadblues » Sat Mar 31, 2018 6:47 pm

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.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 532
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK


Return to SDK Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron