NETOBJECT


9.2, PLBNET GUI Only

square.png Properties

square.png Instructions

 

The NETOBJECT instruction defines a data item for a .Net object. This object can only be executed in a PLB program executing under a PLBNET runtime or a PLBSERVE runtime with a PLBCLINET client. The actual object is determined from the CLASS and ASSEMBLY parameters specified during the CREATE instruction. To define a NETOBJECT, use one of the following statement formats:

 

 

[label]

NETOBJECT

[%][{keyword}[,{keyword}]

 

[label]

NETOBJECT

(arraysize)[{keyword}[,{keyword}]

 

[label]

NETOBJECT

^

 

[label]

NETOBJECT

^,{target}

 

[label]

NETOBJECT

^(arraysize)

 

[label]

NETOBJECT

^(arraysize),({target),...,{target})

 

Where:

label

Optional. A Data Label.

%

Optional. Denotes the item as being GLOBAL.

arraysize

Required. An integer decimal constant, CONST variable, or EQUATEd value indicating the number of array items.

^

Optional. Denotes the item as being a POINTER.

target

Required. The name of a previously defined data item of the same type.

keyword

Optional. Keywords that define further define the object.

Flags Affected: NONE

Note the following:

  1. The CLASS and ASSEMBLY keywords can be specified on the NETOBJECT declaration. The expected format for these keywords is "CLASS=slit" and "ASSEMBLY=slit". See details below on the format of the "slit" literal strings.

  2. When a third party assembly is being used without a fully qualified path, the assembly must be placed either in the same directory where the PLBNET.EXE module exists or the assembly must be installed into the Global Assembly Cache (GAC).

  3. When a third party assembly is being used without a fully qualified path and the '.dll' extension is specified, the location of the assembly file is determined in the following sequence:

  4.  

    1. Directory where PLBNET/PLBCLINET is loaded.

    2. The current directory.

    3. The system directory.

    4. The 16-bit system directory.

    5. The Windows directory.

    6. A directory as specified by the PATH environment variable.

  5. The operations available for a NETOBJECT are defined by the appropriate documentation for the CLASS for the .NET object. See information in the PLBNET runtime description to access .NET online documentation for class library programming components.

  6. The NETOBJECT is created using the CREATE instruction that must have a CLASS and ASSEMBLY keyword specified. Optionally, the .NET class object may have unnamed parameters that must be specified.

  7. The ASSEMBLY information identifies a library that contains the class component specified by the CLASS. See the CREATE instruction for more details on the use of the CLASS and ASSEMBLY keywords.

    The following is a general discussion on the CLASS keyword data format used to specify a .NET object to be created:

    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.

    Example:
         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 special Sunbelt data string syntax the can be appended to clarify requested actions when creating the {target} .NET object. {option} can one of the following:

    ; (semicolon) - Static Object Indicator
    When a ';' character 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 will 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"

    ';{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",ASSEMBLY="mscorlib"
     

  8. The properties are available through the NETOBJECT interface using the following syntax:

    *{name}={value}

    or

    @{svar}={value}

    Where:
    {name} or {svar} is a string variable containing the property name. Property names are case sensitive .NET objects.
    {value} is a character variable, numeric variable, VARIANT, or NETOBJECT object that is assigned to the property as described for the CLASS.

  9. When an NETOBJECT object method is used, the method name identifier is determined by referencing the documentation for the .NET CLASS. The method names are case sensitive. The method can be specified as a keyword form or as a character variable with a leading '@' character. The acceptable syntax forms are as follows:

    {netobject}.methodname GIVING {result} USING {param}

    or

    {netobject}.@{svar} GIVING {result} USING {param}

    The {result} is the expected return value for the method. The variable types for {result} can be a string variable, numeric variable, VARIANT object, or NETOBJECT object. Please reference the vendor .NET documentation for expected return values for the CLASS being used.

    The object method parameters identify the expected values required for the {method}. The keyword name of a given {param} can be determined from the automation vendor documentation. The {param} keyword names may or may not be used. If the {param} name is not specified, the parameter must be placed into the {param} list at a valid position as documented for the method. The {param} can have one of the following syntax forms:

    {value}

    or

    *{name}={value}

    or

    @{svar}={value}

    Where:
    {value} is a character variable, numeric variable, VARIANT, or NETOBJECT object that is assigned to the property.
    {name} is the property name. Property names are case sensitive for NETOBJECT objects.
    {svar} is a string variable containing the property name. Property names are case sensitive for NETOBJECT objects.

  10. When a FORM variable does not have a decimal point, the conversions to a signed .NET data type use the FORM size and the FORM value to determine the .NET data type. The following shows how a simple PLB data variable converts to or from a .NET data variable type:

  11.  

    PLB Data Type

    NET Data Type

    DIM

    System.String

    INTEGER (1 byte)

    System.Byte

    INTEGER (2 byte)

    System.UInt16

    INTEGER (3 byte)

    System.Int32

    INTEGER (4 byte)

    System.Int32

    INTEGER (8 byte)

    System.Int64

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

    System.Int64

    VARIANT (VT_UI8)

    System.UInt64

    VARIANT (VT_R4)

    System.Single

    VARIANT (VT_R8)

    System.Double

    FORM (with decimal pt)

    System.Double

     

    FORM (without decimal point and positive values)

     

    PLB Data Type

    NET Data Type

    FORM SIZE > 19

    System.Double

    FORM SIZE == 19 and FORM value > 9223372036854775807

    System.Double

    FORM SIZE == 19 and FORM value <= 9223372036854775807

    System.Int64

    FORM SIZE > 10

    System.Int64

    FORM SIZE == 10 and FORM value > 2147483647

    System.Int64

    FORM SIZE == 10 and FORM value <= 2147483647

    System.Int32

    FORM SIZE > 5

    System.Int32

    FORM SIZE == 5 and FORM value > 32767

    System.Int32

    FORM SIZE == 5 and FORM value <= 32767

    System.Int16

    FORM SIZE > 3

    System.Int16

    FORM SIZE == 3 and FORM value > 127

    System.Int16

    FORM SIZE == 3 and FORM value <= 127

    System.SByte

    FORM.SIZE < 3

    System.SByte

     

    FORM (without decimal point and negative values)

     

    PLB Data Type

    NET Data Type

    FORM SIZE > 19

    System.Double

    11 <= FORM SIZE <= 19

    System.Int64

    6 <= FORM SIZE <= 10

    System.Int32

    4 <= FORM SIZE <= 5

    System.Int16

    FORM SIZE <= 3

    System.SByte

     

  12. It is possible to create one of the following basic .NET data types as a NETOBJECT with an initial assigned value.

  13.  

    "System.String"

    Text as a series of Unicode characters

    "System.Boolean"

    Boolean value

    "System.SByte"

    8-bit signed integer

    "System.Byte"

    8-bit unsigned integer

    "System.Int16"

    16-bit signed integer

    "System.UInt16"

    16-bit unsigned integer

    "System.Int32"

    32-bit signed integer

    "System.UInt32"

    32-bit unsigned integer

    "System.Int64"

    64-bit signed integer

    "System.UInt64"

    64-bit unsigned integer

    "System.Single"

    Single-precision floating-point number

    "System.Double

    Double-precision floating-point number

     

    Example:

     

    NETSTR

    NETOBJECT

    CLASS="System.String",ASSEMBLY="mscorlib"

    NETBYTE

    NETOBJECT

    CLASS="System.Byte",ASSEMBLY="mscorlib"

    NETINT16

    NETOBJECT

    CLASS="System.Int16",ASSEMBLY="mscorlib"

    .

     

     

    DIMX

    INIT

    "TEST"

    F2

    FORM

    "21"

    I2

    INTEGER

    2,"0x7F"

    .

     

     

     

    CREATE

    NETSTR,*$=DIMX

     

    CREATE

    NETSTR,*$="abc"

    .

     

     

     

    CREATE

    NETBYTE,*$=F2

    .

     

     

     

    CREATE

    NETINT16,*$=I2

  1. When one of the following .NET data types is being created and a PLB FORM value is used for the assigned value, the following tables identify the rules for conversion that are used:

  2.  

    "System.SByte"

    8-bit signed integer

    "System.Byte"

    8-bit unsigned integer

    "System.Int16"

    16-bit signed integer

    "System.UInt16"

    16-bit unsigned integer

    "System.Int32"

    32-bit signed integer

    "System.UInt32"

    32-bit unsigned integer

    "System.Int64"

    64-bit signed integer

    "System.UInt64"

    64-bit unsigned integer

     

    Where:

    E

    Error occurs because assignment is not allowed.

    Y

    NETOBJECT is created with assigned value.

     

         Positive FORM Values

     

    NET Data Types

    SByte

    Byte

    Int16

    UInt16

    Int32

    UInt32

    Int64

    UInt64

    0 - 127

    Y

    Y

    Y

    Y

    Y

    Y

    Y

    Y

    128 - 255

    E

    Y

    Y

    Y

    Y

    Y

    Y

    Y

    256 - 32767

    E

    E

    Y

    Y

    Y

    Y

    Y

    Y

    32768 - 65535

    E

    E

    E

    Y

    Y

    Y

    Y

    Y

    65536 - 2147483647

    E

    E

    E

    E

    Y

    Y

    Y

    Y

    2147483648 - 4294967295

    E

    E

    E

    E

    E

    Y

    Y

    Y

    4294967296 - 9223372036854775807

    E

    E

    E

    E

    E

    E

    Y

    Y

    9223372036854775808 - 18446744073709551615

    E

    E

    E

    E

    E

    E

    E

    Y

    Greater Than 18446744073709551615

    E

    E

    E

    E

    E

    E

    E

    E

     

         Negative FORM Values

     

    NET Data Types

    SByte

    Byte

    Int16

    UInt16

    Int32

    UInt32

    Int64

    UInt64

    -1 - -127

    Y

    E

    Y

    E

    Y

    E

    Y

    E

    -128 - -255

    E

    E

    Y

    E

    Y

    E

    Y

    E

    -256 - -32767

    E

    E

    Y

    E

    Y

    E

    Y

    E

    -32768 - -65535

    E

    E

    E

    E

    Y

    E

    Y

    E

    -65536 - -2147483647

    E

    E

    E

    E

    Y

    E

    Y

    E

    -2147483648 - -4294967295

    E

    E

    E

    E

    E

    E

    Y

    E

    -4294967296 - -9223372036854775807

    E

    E

    E

    E

    E

    E

    Y

    E

    -9223372036854775808 - -18446744073709551615

    E

    E

    E

    E

    E

    E

    E

    E

    Less Than -18446744073709551615

    E

    E

    E

    E

    E

    E

    E

    E

     

  3. This object is not available when using the PL/B Web Server.

 

 

See Also: Object Definitions, Object Output Instructions

 



PL/B Language Reference NETCONTROL OBJECT