ComplexItem

 

Remarks Properties Methods DynProperties Samples

ED
avaliable
RT
read only

Remarks:Top

This object represents the items of a structure datatype.



DynProperties:

	Editor   -> readable & writeable

	Runtime  -> not readable & not writeable

Properties:Top

Parent    

Methods:Top

DynPropertiesEnum[GET] DynProperties[GET] DynProperties[PUT]
MoveItemDown MoveItemUp  

DynProperties:Top

Name Type Description
BitOffset Long

Bit offset

Bit number of the structure element in the structure.

Read more in the online manual

Description String

Description

Description of the datatype.

Read more in the online manual

Dim1 Long

Array Dim 1

Size of the first dimension of the array.

Read more in the online manual

Dim2 Long

Array Dim 2

Size of the second dimension of the array.

Read more in the online manual

Dim3 Long

Array Dim 3

Size of the third dimension of the array.

Read more in the online manual

HasRef Boolean

linked with datatype

Active: The element is linked to the basic datatype. Changes in the basic datatype directly affect the element. Properties in the element can no longer be edited.
Inactive: The element is no longer linked to the basic datatype.

Read more in the online manual

ID_DataTyp Long

IEC datatype

Basic datatype.

ATTENTION: If the basic datatype is changed all the other properties of the datatype have to be checked resp. modified.

Read more in the online manual

ItemIndex Long

Pos. in structure

Position of the variable in the structure.

Read more in the online manual

LBound Long

Array start index

Select the start index of the array from the dropdown list.

More in the online help

Name String

Name

Name of the datatype.

ATTENTION: This property is not available for language switching.

Read more in the online manual

Offset Long

Offset

Offset of the structure element in the structure.

Read more in the online manual

TypeID Long

Samples:Top

Public Sub test_IComplexItem()
	Dim zComplexItem As ComplexItem
	Dim zVarTypes As VarTypes
	Dim i As Integer, j As Variant, k As Long

	Set zVarTypes = thisProject.VarTypes
	For i = 0 To zVarTypes.Count - 1
		If (zVarTypes.Item(i).IsSimple = 0 And zVarTypes.Item(i).SubItemCount > 1) Then
			Set zComplexItem = zVarTypes.Item(i).SubItem(1)
		
			'write properties
			zComplexItem.DynProperties("BitOffset") = 2				'EDwriteable
			zComplexItem.DynProperties("Description") = "YourDescr..." 'EDwriteable
			zComplexItem.DynProperties("Dim1") = 2					 'EDwriteable
			zComplexItem.DynProperties("Dim2") = 2					 'EDwriteable
			zComplexItem.DynProperties("Dim3") = 2					 'EDwriteable
			Debug.Print zComplexItem.DynProperties("HasRef")		 'ReadOnly
			zComplexItem.DynProperties("ID_DataTyp") = 19			'EDwriteable
			Debug.Print zComplexItem.DynProperties("ItemIndex")		'ReadOnly
			zComplexItem.DynProperties("Name") = "YourName"			'EDwriteable
			zComplexItem.DynProperties("Offset") = 10				'EDwriteable
		 
			'read properties
			Debug.Print zComplexItem.DynProperties("BitOffset")
			Debug.Print zComplexItem.DynProperties("Description")
			Debug.Print zComplexItem.DynProperties("Dim1")
			Debug.Print zComplexItem.DynProperties("Dim2")
			Debug.Print zComplexItem.DynProperties("Dim3")
			Debug.Print zComplexItem.DynProperties("HasRef")
			Debug.Print zComplexItem.DynProperties("ID_DataTyp")
			Debug.Print zComplexItem.DynProperties("ItemIndex")
			Debug.Print zComplexItem.DynProperties("Name")
			Debug.Print zComplexItem.DynProperties("Offset")
	
			'Methods
			zComplexItem.MoveItemDown
			zComplexItem.MoveItemUp
		End If
	Next i
End Sub