Creating Structure Datatypes and assign variables to a specific one

Creating Structure Datatypes and assign variables to a specific one

Hello,
I want to create a structure datatype with VBA (this could also be done manually if the VBA solution is to complex).
The following part is more important for me.
As next step i want to search all variables for a certain string pattern, if i find one it should be put under the appropiate structure variable.
Example:
Structure:
+ engine
¦-- torque
¦-- power
¦-- engine displacement

Example Variablelist:
-somevar1
-somevar2
-myengine.power
-otherengine.power
-myengine.engine_displacement
-somevar3
-myengine.torque
If my algorithm is invoked with a search parameter "myengine". Now the "flat variables" are put into the structure described above.
Resulting structre:
+ myengine
¦-- myengine.torque
¦-- myengine.power
¦-- myengine.engine_displacement

I think is it not possible with vba api to put an existing non-structure variable under a structure.
Perhaps when i find a result i can create a new empty structre (if it not exists already). Then copy all values (name, limits, etc.) of the result variable to the corresponding part in the structure and delete the flat variable after copying all attributes.
But i have no idea what i have to copy to create a new variable with exactly the same attributes.
Please help me with my problem, i thank you in advance.

This is a migrated post! Originally posted on 23.03.2009 by user mastr. Please be aware that information can be outdated.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com