IPB_Session interface:
Add<type>Argument method
Description
Adds an argument of a specific type in a variable argument PowerBuilder call.
Syntax
AddArrayArgument ( PBCallInfo *ci, pbblob value, pbboolean IsNull )
AddBlobArgument ( PBCallInfo *ci, pbblob value, pbboolean IsNull )
AddBoolArgument ( PBCallInfo *ci, pbboolean value, pbboolean IsNull )
AddByteArgument ( PBCallInfo *ci, pbbyte value, pbboolean IsNull )
AddCharArgument ( PBCallInfo *ci, pbchar value, pbboolean IsNull )
AddDateArgument ( PBCallInfo *ci, pbdate value, pbboolean IsNull )
AddDateTimeArgument ( PBCallInfo *ci, pbdatetime value, pbboolean IsNull )
AddDecArgument ( PBCallInfo *ci, pbdec value, pbboolean IsNull )
AddDoubleArgument ( PBCallInfo *ci, pbdouble value, pbboolean IsNull )
AddIntArgument ( PBCallInfo *ci, pbint value, pbboolean IsNull )
AddLongArgument ( PBCallInfo *ci, pblong value, pbboolean IsNull )
AddLongLongArgument ( PBCallInfo *ci, pblonglong value, pbboolean IsNull )
AddObjectArgument ( PBCallInfo *ci, pbobject value, pbboolean IsNull )
AddPBStringArgument ( PBCallInfo *ci, pbstring value, pbboolean IsNull )
AddRealArgument ( PBCallInfo *ci, pbreal value, pbboolean IsNull )
AddStringArgument ( PBCallInfo *ci, LPCTSTR value, pbboolean IsNull )
AddTimeArgument ( PBCallInfo *ci, pbtime value, pbboolean IsNull )
AddUintArgument ( PBCallInfo *ci, pbuint value, pbboolean IsNull )
AddUlongArgument ( PBCallInfo *ci, pbulong value, pbboolean IsNull )
Argument |
Description |
---|---|
ci |
The PBCallInfo to which the argument is to be added. |
value |
The value to be added to the arguments array. |
IsNull |
Indicates whether the argument is null. The default is false. |
Return Values
PBXRESULT. PBX_OK on success.
Examples
This code tests that adding an integer argument to a PBCallInfo structure ci works correctly:
long Cmy_pbni:: f_Retrieve(IPB_Session* session, pbint retrieve_args, pbobject dwobj)
{
pbclass cls;
pbmethodID mid;
PBCallInfo* ci = new PBCallInfo;
pblong ret_val;
PBXRESULT ret;
cls = session-> GetClass(dwobj);
mid = session-> GetMethodID
(cls, "retrieve", PBRT_FUNCTION, "LAV");
if (mid == kUndefinedMethodID)
return -1;
session-> InitCallInfo(cls, mid, ci);
ci-> pArgs-> GetAt(0)-> SetInt(retrieve_args);
session-> AddIntArgument(ci, retrieve_args, false);
ret = session->InvokeObjectFunction(dwobj, mid, ci);
if (ret!= PBX_OK)
ret_val= ret;
else
ret_val= ci-> returnValue-> GetLong();
session-> FreeCallInfo(ci);
delete ci;
return ret_val;
}
Usage
This call is used in variable argument PowerBuilder calls, such as datawindow.retrieve(arg). After the call, the value returned by ci->pArgs->GetCount() increases by one.