createBoxedPrimitive

createBoxedPrimitive(value: Any);

The createBoxedPrimitive method of the JadeDotNetType class creates a .NET object containing the JADE primitive value. This enables a JADE primitive value to be used in .NET as if it were a .NET object.

The value parameter must be a JADE primitive type; for example, Integer, Decimal, Boolean, TimeStamp, String or StringUtf8. However, subclasses of the Object class and the primitive array classes are not allowed. An exception (14577 - Failed to create .NET object) is raised if the value parameter is not an allowed type.

The following example shows the use of the createBoxedPrimitive method.

vars
    a : Any;
    x : JadeDotNetType;
    t : TimeStamp;
begin
    create x;
    // Create .NET object from primitive
    // (similar to using createDotNetObject(), to create the .NET object)
    x.createBoxedPrimitive(t);
    // 'x' can now be used where a JadeDotNetObject is used
    // Get back a JADE primitive from previously created .NET object
    a := x.getBoxedPrimitive();
    write a;
epilog
    delete x;
end;