Results 1 to 8 of 8

Thread: Messy Code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Messy Code

    I'm just about finished coding an app, but the last bit I've been working on (the report creator) I find is very messy and complicated to look at.

    Is there any way that this can be tidied up to be cleaner, more efficient and easier to look at?

    Messy Code

    Anyone able to help me out here?

  2. #2
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Messy Code

    For a start can you create your dims at the start instead of in the actual loop and just assign values to them in the loop. I think your code will be wasting memory creating dims every time the loop executes.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Re: Messy Code

    OK, and how about the loops? Is there a better way of passing that information around without doing so many loops and file readings?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Re: Messy Code

    I have now cleaned it up so well that some of it doesn't show up correctly... and I didn't make a backup either... I think I'm going to cry...

    If someone can see where I messed up please feel free to point it out to me, elsewise I know what I'm doing tomorrow...

    :-/

  5. #5
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Messy Code

    Im going home shortly so I probably cant help you today , but which bit isnt showing up correctly can you be more specific.

  6. #6
    Member
    Join Date
    Apr 2004
    Posts
    59

    Re: Messy Code

    can you upload your vs.net project so i can check it out?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Re: Messy Code

    The chunk that doesn't display is this:

    VB Code:
    1. If counterFix = 0 Then
    2.   If lineAnswer(4) = 0 Then
    3.     tempStr....
    4.   Else
    5.     tempStr...
    6.   End If
    7. End If

    I'm going to try re-code it

    Unless someone can help me quickly point out the mistake I've done whilst "tidying" up....

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    England
    Posts
    79

    Re: Messy Code

    OK fixed it, had to close some files at the end of some loops, and then reset some variables to 0 and it worked fine :-/

    Stupid mistakes...

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