Set<type>

PowerBuilder Native Interface

IPB_Value interface:

Set<type> method

Description

Syntax

SetArray ( pbarray array ) 
SetBlob( pbblob blob ) 
SetBool ( pbboolean boolean ) 
SetByte ( pbbyte byte ) 
SetChar ( pbchar char ) 
SetDate ( pbdate date ) 
SetDateTime( pbdatetime datetime ) 
SetDecimal ( pbdecimal dec) 
SetDouble ( pbdouble double) 
SetInt ( pbint int ) 
SetLong( pblong long ) 
SetLongLong( pblonglong longlong ) 
SetObject ( pbobject object ) 
SetPBString ( pbstring string) 
SetReal( pbreal real ) 
SetString ( LPCTSTR string) 
SetTime( pbtime time ) 
SetUint( pbuint uint ) 
SetUlong ( pbulong ulong ) 

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);

// Call IPB_Value SetPBString method
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("");

// Call IPB_Session SetString method
Session -> SetString(ret_val, Session->GetString
               (ci->returnValue->GetString()));
Session -> FreeCallInfo(ci);
delete ci;
return ret_val;

Usage

See Also