IiopSetAnyAsString Function

Action

Assigns a string to an instance of the Any type and associates the instance with a CORBA object. The instance of the Any type is created and released automatically. This function can be used to set parameters of a request in advance of calling the IiopRequest function.

Include file

IIOP.bdh

Syntax

IiopSetAnyAsString( in hIiop   : number,
                    in sString : string,
                    in nFlags  : number optional,
                    in nMaxLen : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object.
sString String that is assigned to the instance of the Any type and then associated with the CORBA object.
nFlags Specifies whether to pass the string as a sequence of ASCII characters or wide characters (optional). By default, the string is passed as a sequence of ASCII characters.
nMaxLen Specifies the maximum string length of sString.

Example

dcltrans
  transaction TMain
  const
    HOST   := "192.168.20.21"; // server
    PORT   := 1052; // port
    KEY    := "...\h00"; // key
    KEYLEN := 4; // key length
  var
    hIiop: number; // handle to CORBA object
  begin
    IiopSetMaxGiopVersion("1.2");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);

    // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2",
                     HOST, PORT, KEY, KEYLEN);

    // pass string parameter to request
    IiopSetAnyAsString(hIiop, "Hello world!");

    // call operation "Print" with string parameter
    IiopRequest(hIiop, "Print");
    IiopObjectRelease(hIiop);
  end TMain;