SetString

PowerBuilder Native Interface

IPB_Session interface:

SetString method

Description

Syntax

SetString (pbstring string, LPCTSTR src)

Return Values

Examples

pbclass cls;
pbmethodID mid;
PBCallInfo* ci = new PBCallInfo;
pbstring ret_val;
LPCTSTR pStr;

cls= Session -> GetClass(myobj);
if (isAny)
   mid=Session-> GetMethodID(cls, "uf_any_byvalue",
      PBRT_FUNCTION, "AAAAA");
else
   mid=Session-> GetMethodID(cls, "uf_string_byvalue",
      PBRT_FUNCTION, "SSSSS");
Session-> InitCallInfo(cls, mid, ci);

ci-> pArgs -> GetAt(0) -> SetPBString(s_low);
ci-> pArgs -> GetAt(1) -> SetPBString(s_mid);
ci-> pArgs -> GetAt(2) -> SetPBString(s_high);
pStr = Session -> GetString(s_null);
if (pStr != 0)
{
   if (strcmp(pStr, "null") == 0 )
      ci-> pArgs -> GetAt(3) -> SetToNull();
   else
      ci-> pArgs -> GetAt(3) -> SetPBString(s_null);
}
Session -> InvokeObjectFunction(myobj, mid, ci);
ret_val = Session -> NewString("");
Session -> SetPBString(ret_val, Session->GetString
               (ci->returnValue->GetString()));
Session -> FreeCallInfo(ci);
delete ci;
return ret_val;

Usage

See Also