Results 1 to 9 of 9

Thread: Indents please

  1. #1

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Indents please

    Another thing I do and would like opinions on:
    I only fully left align;

    General declarations - not sure if this includes Function & Sub declarations but I mean it to.

    Navigational labels

    Debug.Prints
    Debug MsgBox lines

    The last 2 so they are easy to find and remove when the prog is finished.

    Any comments?

  2. #2
    Fanatic Member HaxSoft's Avatar
    Join Date
    May 2000
    Location
    Ohio
    Posts
    593

    Re: Indents please

    Originally posted by GlenW
    Another thing I do and would like opinions on:
    I only fully left align;
    .
    .
    .
    Debug.Prints
    Debug MsgBox lines

    The last 2 so they are easy to find and remove when the prog is finished.

    Any comments?
    Very good, I will do the same from now on. I always have problems finding those and deleting them after testing/debugging.

    Thanks for a good tip.

  3. #3
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    ...Debug.Prints
    Debug MsgBox lines
    You should define a compile time constant DEBUG and put such lines in:
    VB Code:
    1. #IF DEBUG Then
    2.      MsgBox "This is a debug thingy"
    3. #End If

    That way to remove the msgbox you just unset the compile time directive and compile it...
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  4. #4
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    i do exactly the same.

    makes code dead easy to read too
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  5. #5
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    I only put them in when I need them, solve the problem and then take them out again. Then I don't have to worry about it.

  6. #6

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Originally posted by MerrionComputin


    You should define a compile time constant DEBUG and put such lines in:
    VB Code:
    1. #IF DEBUG Then
    2.      MsgBox "This is a debug thingy"
    3. #End If

    That way to remove the msgbox you just unset the compile time directive and compile it...
    Does this not produce an unnecessary run time overhead?

  7. #7
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    No, it doesn't get compiled.

  8. #8
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    i think the term is "Conditional Compilation"
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  9. #9

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    I learn something new every day
    Every day in every way I'm getting better and better.

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