Many ObjectARX global functions return an integer status code that indicates whether the function call succeeded or failed.
The code RTNORM indicates that the function succeeded; other codes indicate failure or special conditions. Library functions that return a status code pass their actual results (if any) back to the caller through an argument that is passed by reference. To determine how a particular global function uses its arguments and return values, consult its reference documentation.
Consider the following prototyped declarations for a few typical ObjectARX functions:
int acdbEntNext(ads_name ent, ads_name result); int acedOsnap(ads_point pt, char *mode, ads_point result); int acedGetInt(char *prompt, int *result);
An application could call these functions with the following C++ statements:
stat = acdbEntNext(ent, entres); stat = acedOsnap(pt, mode, ptres); stat = acedGetInt(prompt, &intres);
After each function is called, the value of the stat variable indicates either success (stat == RTNORM) or failure (stat == RTERROR or another error code, such as RTCAN for cancel). The last argument in each list is the result argument, which must be passed by reference. If successful, acdbEntNext() returns an entity name in its entres argument, acedOsnap() returns a point in ptres, and acedGetInt() returns an integer result in intres. (The types ads_name and ads_point are array types, which is why the entres and ptres arguments don't explicitly appear as pointers.)