Results 1 to 2 of 2

Thread: Iterate members of a structure(possible ?)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Iterate members of a structure(possible ?)

    Well i am trying to find if this is possible
    I am trying to make a config file for my WM application and i have this idea but i don't know if this is doable.
    Well lets describe it
    I want to pass some variables to a function that will be read from a configuration file
    I am thinking it a nice programming technique to organize this variables to a structure
    So far everything is good
    Now the question is how to iterate these structure variables
    Example
    Structure MyStructure
    Dim Var1 as string
    Dim Var2 as string
    Dim Var3 as boolean
    end structure

    the config file will have this formulation: (always)
    Var1:test1
    Var2:test2
    Var3:True

    So when i read this config file i want something like this
    -------------------------
    index = 0
    Do
    line = sr.ReadLine()
    mystructure(index) =split(line,":")(1) < ---- Something like that that will not force me to write everything everytime but loop through the members of the structure
    index = index +1
    Loop Until line Is Nothing
    ----------------------------

    Thanks in advance
    Any idea that will help me implements this more than welcomed

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: Iterate members of a structure(possible ?)

    If you want something to do that you have 2 options:
    Write a function that does this
    Use a class
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width