CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: Need help with bracket counter for project

    That's probably because there's a starting bracket ({) in the beginning of the file that doesn't have an ending bracket. Remove it and try again.

    EDIT: That's part of the test file? In the original file, remove the brackets that are enclosing the entire file. If I'm right your file is formatted like this:

    Code:
    using this;
    using that;
    
    {
    
    
    class1
    {
    
    }
    class2
    {
    
    }
    
    ... //more classes
    
    
    }
    This will make my code put it all in one file. Make sure your file is formatted like this:

    Code:
    using this;
    using that;
    
    class1
    {
    
    }
    class2
    {
    
    }
    
    ... //more classes
    Last edited by foamy; June 17th, 2010 at 08:50 AM.
    It's not a bug, it's a feature!

  2. #17
    Join Date
    Jun 2010
    Posts
    23

    Re: Need help with bracket counter for project

    I cant do anythign about what the file I will be parsing looks like...it is auto-generated code that just compiles into one big file....

    let me show you what i'm talking about with the [System.]thing:
    this is how each class starts off:

    Code:
    [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.2152")]
        [System.SerializableAttribute()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        public partial class PersonType1
    and then the first "{" and then the rest of the code.

    Would it be possible to mark the beginning of a class...and then somehow go backwards until you reach the end of the last class and then store the code in between?

  3. #18
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Need help with bracket counter for project

    Your attached file has a { before those lines that is what's causing the problem.
    Always use [code][/code] tags when posting code.

  4. #19
    Join Date
    Jun 2010
    Posts
    23

    Re: Need help with bracket counter for project

    WOW my ADD is cathcing up with me once again haha here's an updated version >_<
    Attached Files Attached Files

  5. #20
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: Need help with bracket counter for project

    ... And have you tried running the code with the file that doesn't have the extra brackets?
    It's not a bug, it's a feature!

Page 2 of 2 FirstFirst 12

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

Featured