DzemoDzem
08-06-2014, 08:39 AM
Hello everyone,
I am new at VBA and I am working on a Project were I have lot of Custom Data Types.
My module named Modul1 is:
Type CNODE ' 20/00 Nodes
m_NR As Long ' node-number
m_INR As Long ' internal node-number
m_KFIX As Long ' degree of freedoms
m_NCOD As Long ' additional bit code
m_XYZ(1 To 3) As Single ' [1001] X-Y-Z-ordinates
End Type
Type CNODE_GRC ' 20/11:0 number of Nodegroups
m_ID As Long
m_MAXGRP As Long ' maximum number of groups per node
End Type
...
and in my second Modul2 i have:
Option Explicit
'CDB Code For Getting the Database DATA
'Read THE CDB
Public Sub ReadCDB(datei As String)
Dim row As Long
Dim pos As Integer
Dim data As VARIABLEVALUE 'HOW CAN I INPUT THE STRING VARIABLE VALUE, SOMETIMES IT IS CNODE, SOMETIMES CNODE_GRC...
Dim DataLen As Long
Dim Index As Long
Dim InitIndex As Long
Dim Column As Long
Dim Sum As Long
How can I declare Dim data As ValueFromAStringVariable or insert a code here from StringVariableValue
Second problem that I have is:
Is it possible to work with CUSTOM TYPE as if it is array.
For Example:
FOR i=1 to 3
Worksheets(1).Cells(row, Column).Value = data.m_INR '(instead of name, to add element number)
NEXT
END
Is it possible to get the number of elements in Custom TYPE and then say data.element(i) where the i the element number.
FOR CNODE that I can say element data.element(1) is data.m_NR, data.element(2) is data.m_INR...
If you have a good tutorial or resolved this in past. Please share it.
Kind regards,
ST
I am new at VBA and I am working on a Project were I have lot of Custom Data Types.
My module named Modul1 is:
Type CNODE ' 20/00 Nodes
m_NR As Long ' node-number
m_INR As Long ' internal node-number
m_KFIX As Long ' degree of freedoms
m_NCOD As Long ' additional bit code
m_XYZ(1 To 3) As Single ' [1001] X-Y-Z-ordinates
End Type
Type CNODE_GRC ' 20/11:0 number of Nodegroups
m_ID As Long
m_MAXGRP As Long ' maximum number of groups per node
End Type
...
and in my second Modul2 i have:
Option Explicit
'CDB Code For Getting the Database DATA
'Read THE CDB
Public Sub ReadCDB(datei As String)
Dim row As Long
Dim pos As Integer
Dim data As VARIABLEVALUE 'HOW CAN I INPUT THE STRING VARIABLE VALUE, SOMETIMES IT IS CNODE, SOMETIMES CNODE_GRC...
Dim DataLen As Long
Dim Index As Long
Dim InitIndex As Long
Dim Column As Long
Dim Sum As Long
How can I declare Dim data As ValueFromAStringVariable or insert a code here from StringVariableValue
Second problem that I have is:
Is it possible to work with CUSTOM TYPE as if it is array.
For Example:
FOR i=1 to 3
Worksheets(1).Cells(row, Column).Value = data.m_INR '(instead of name, to add element number)
NEXT
END
Is it possible to get the number of elements in Custom TYPE and then say data.element(i) where the i the element number.
FOR CNODE that I can say element data.element(1) is data.m_NR, data.element(2) is data.m_INR...
If you have a good tutorial or resolved this in past. Please share it.
Kind regards,
ST