CREATE NETCONTROL or NETOBJECT


PLBNET GUI Only

square.png Properties

square.png Instructions

 

The CREATE statement initializes a NETCONTROL or NETOBJECT variable. The statement format is:

 

 

[label]

CREATE

NETCONTROL[,CLASS={classid}][,ASSEMBLY={assembly}]:

 

 

 

[*$={param}[,*$={param1}]...]:

 

 

 

[{proplist}...]

 

 

 

 

 

[label]

CREATE

NETOBJECT[,CLASS={classid}][,ASSEMBLY={assembly}]:

 

 

 

[*$={param}[,*$={param1}]...]:

 

 

 

[{proplist}...]

 

Where:

label

Optional. A Program Execution Label.

classid

Optional. A Character String Variable or Literal defining a unique .NET class identification.

assembly

Optional. A Character String Variable or Literal defining a unique .NET assembly library that contains the .NET object specified in the {classid}.

param

Optional. A Character String Variable, Numeric Variable, Literal, Integer, VARIANT, or NETOBJECT.

proplist

Optional. One or more of the .NET object properties as described in the class library.

Flags Affected: NONE

Note the following:

  1. The CLASS string is composed of a class namespace and the .NET object class name.

  2. The CLASS data string is case sensitive.

  3. The ASSEMBLY name must be specified as defined for the namespace and class for the .NET object.

  4. An assembly is a partially compiled code library that contains code and data that allows a .NET object to be created dynamically.

  5. The '*$' {param} syntax identifies a parameter required to create a .NET object as documented in the class library.

  6. Any PLB data variable types must match the expected .NET parameter data typeswhen used as {param} or {proplist} as per the following conversion:

  7.  

    PLB Data Type

    .NET Data Type

    DIM

    System.String

    FORM without decimal point

    System.Int32

    FORM with decimal point

    System.Double

    INTEGER (1 byte)

    System.Byte

    INTEGER (2 byte)

    System.UInt16

    INTEGER (3 byte)

    System.Int32

    INTEGER (4 byte)

    System.Int32

    VARIANT (VT_BSTR)

    System.String

    VARIANT (VT_BOOL)

    System.Boolean

    VARIANT (VT_I1)

    System.SByte

    VARIANT (VT_UI1)

    System.Byte

    VARIANT (VT_I2)

    System.Int16

    VARIANT (VT_UI2)

    System.UInt16

    VARIANT (VT_I4)

    System.Int32

    VARIANT (VT_UI4)

    System.UInt32

    VARIANT (VT_R4)

    System.Single

    VARIANT (VT_R8)

    System.Double

     

  8. The {parent} WINDOW is ignored for the initial release of the runtime.

  9. The data specified by the CLASS keyword is expected to have the following data format:

 

CLASS="{Namespace}.{target}[{option}]"

 

Where:

{Namespace} specifies a unique name for a group of .NET programming components. The Namespace data string is case-sensitive and must be specified exactly as documented by the .NET class library.

 

Examples:

     System.IO

     System.String

 

{target} specifies the .NET final target programming component to be created. The target data string is case-sensitive and must be specified exactly as documented by the .NET class library. Generally, the target programming components being created are identified as a class, enumeration, or structure component as documented in the .NET class library.

 

{option} provides a special Sunbelt data string syntax the can be appended to clarify requested actions when creating the {target} .NET object.

 

Where {option} can one of the following:

 

; (semicolon) - Static Object Indicator

When a semicolon is appended to the {target} .NET object, the .NET object is created as a Static object. This syntax format is required when the MSDN documentation for .NET object specifies the 'S' character as an attribute for the Name description for the members of {target} in the class library descriptions.

 

Example:

 

CREATE NETOBJECT,CLASS="System.IO.File;",ASSEMBLY="mscorlib"

 

':MemberName' - Enumeration Member

When the Member Name from a .NET Enumeration is to be created, the ':MemberName' format must be appended to the .NET {target}. The 'MemberName' used in this CLASS syntax format identifies the Member Name of the Enumeration member as documented in the .NET class library descriptions in the MSDN documentation. When this syntax format is used, the NETOBJECT is created with enumeration value of the Member name that is specified.

 

Example:

 

CREATE NETOBJECT,CLASS="System.IO.FileMode:Append",ASSEMBLY="mscorlib"

 

The ':MemberName' can also be specified as a list of enumeration members that are ORed into a single value when the enumeration class allows multiple members to be combined. The list of members can be separated with a delimiting comma character.

 

Example:

 

 

CREATE NETOBJECT, Class="System.Drawing.FontStyle:Bold,Italic",Assembly="System.Drawing"

 

';{target}' - Create the Type Class for the {target} .NET object.

The {target} is the .NET target component as documented in the class library. The ';{target}' syntax format is a shortcut that creates a NETOBJECT with the Type Class data for the {target} .NET object. Review the 'System.Type' class library description in the MSDN class library documentation to see all of the information available about a given .NET object.

 

Example:

 

CREATE NETOBJECT,CLASS="System.String;String",ASSEMBLY="mscorlib"

 

  1. If the CLASS and/or ASSEMBLY are specified on the NETOBJECT declaration, a warning is given if the CLASS and/or ASSEMBLY is also specified on the CREATE instruction. In this case, the CLASS and/or ASSEMBLY on the CREATE instruction overrides the keyword settings specified on the NETOBJECT declaration. Also, note that no warnings are given if the NETOBJECT for the CREATE is a NETOBJECT pointer.

 

 

See Also: Example Code, CREATE, Object Output Instructions

 



PL/B Language Reference