Results 1 to 4 of 4

Thread: Nested Structures [resolved]

  1. #1

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Nested Structures [resolved]

    I am developing a structure, and in this structure I need an array of a structure like this

    VB Code:
    1. Public Structure StrategyStruct
    2.         Public Name As String
    3.         Public Mode As RunMode
    4.         Public Structure Steps()
    5.             Public StepType As StepTypes
    6.             Public DesiredOutput As String
    7.             Public Time As String
    8.         End Structure
    9.     End Structure
    Unfortunately the above code results in an End of statement expected error. Does anyone understand what I am trying to do, and have a method of doing it without an error?
    thanks
    kevin

    ps
    the error occurs on
    VB Code:
    1. Public Structure Steps[B]()[/B]
    Last edited by kebo; Mar 17th, 2005 at 02:28 PM. Reason: resolved
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Nested Structures

    Try this:
    VB Code:
    1. Public Structure StrategyStruct
    2.         Public Name As String
    3.         Public Mode As RunMode
    4.         Public Steps() As StepStruct
    5.         Public Structure StepStruct
    6.             Public DesiredOutput As String
    7.             Public Time As String
    8.         End Structure
    9.     End Structure
    I don't live here any more.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Nested Structures

    Alternatively, you could simply define the inner structure outside the outer structure. If it was part of a library, that could cause problems if somebody was able to see the inner structure when you didn't want them to, but otherwise it shouldn't matter much.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Nested Structures

    cool, thanks coding dudes!
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

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