Capitalize Variable Names

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry

    Capitalize Variable Names

    I am using VB.Net 2003, IDE.

    When I type a variable name that already has been Dim'd,
    The IDE doesn't make the variable name Capitalized,
    even though the variable name definition in the Dim is capitalized.

    VB 6 will do this.

    Where is the setting so that this will happen. Someone else here at work
    uses VB.Net 2003, and his IDE does capitalize variables.

    Thanks in Advance,

    Larry
  • Homer J Simpson

    #2
    Re: Capitalize Variable Names


    "Larry" <bliff@Blifff.c om> wrote in message
    news:OpCzRY6UGH A.5172@TK2MSFTN GP12.phx.gbl...
    [color=blue]
    > I am using VB.Net 2003, IDE.
    >
    > When I type a variable name that already has been Dim'd,
    > The IDE doesn't make the variable name Capitalized,
    > even though the variable name definition in the Dim is capitalized.
    >
    > VB 6 will do this.
    >
    > Where is the setting so that this will happen. Someone else here at work
    > uses VB.Net 2003, and his IDE does capitalize variables.[/color]

    Have you got Option Explicit on?



    Comment

    • R. MacDonald

      #3
      Re: Capitalize Variable Names

      Hello, Larry,

      It's nested fairly deeply. Select "Options" from the "Tools" menu.
      Then choose the "Text Editor" folder and under that the "Basic"
      sub-folder. In there, choose the "VB Specific" entry and look at the
      setting of the "Pretty Listing" check box.

      My recollection is that this setting also affects a number of other
      formatting related items. It took me a while to get used to them. But
      the only one that I still object to is the way it insists on
      repositioning comments that follow an in-line "If" statement.

      Cheers,
      Randy


      Larry wrote:[color=blue]
      > I am using VB.Net 2003, IDE.
      >
      > When I type a variable name that already has been Dim'd,
      > The IDE doesn't make the variable name Capitalized,
      > even though the variable name definition in the Dim is capitalized.
      >
      > VB 6 will do this.
      >
      > Where is the setting so that this will happen. Someone else here at work
      > uses VB.Net 2003, and his IDE does capitalize variables.
      >
      > Thanks in Advance,
      >
      > Larry[/color]

      Comment

      • CMM

        #4
        Re: Capitalize Variable Names

        I have noticed this as well. "Auto-recognition" of declared variables has
        been made stupider in VS2005. It worked great in VS2003. Option Strict and
        Explicit all on here. I notice it all the time... but never bothered to
        figure out why.

        I pretend "I didn't just see that".... considering this worked and has been
        working great in VB for TEN years. And, now it doesn't.

        --
        -C. Moya

        "R. MacDonald" <scitec@NO-SP-AMcips.ca> wrote in message
        news:442b81e7$0 $6030$dbd41001@ news.wanadoo.nl ...[color=blue]
        > Hello, Larry,
        >
        > It's nested fairly deeply. Select "Options" from the "Tools" menu. Then
        > choose the "Text Editor" folder and under that the "Basic" sub-folder. In
        > there, choose the "VB Specific" entry and look at the setting of the
        > "Pretty Listing" check box.
        >
        > My recollection is that this setting also affects a number of other
        > formatting related items. It took me a while to get used to them. But
        > the only one that I still object to is the way it insists on repositioning
        > comments that follow an in-line "If" statement.
        >
        > Cheers,
        > Randy
        >
        >
        > Larry wrote:[color=green]
        >> I am using VB.Net 2003, IDE.
        >>
        >> When I type a variable name that already has been Dim'd,
        >> The IDE doesn't make the variable name Capitalized,
        >> even though the variable name definition in the Dim is capitalized.
        >>
        >> VB 6 will do this.
        >>
        >> Where is the setting so that this will happen. Someone else here at work
        >> uses VB.Net 2003, and his IDE does capitalize variables.
        >>
        >> Thanks in Advance,
        >>
        >> Larry[/color][/color]


        Comment

        • dgk

          #5
          Re: Capitalize Variable Names

          On Thu, 30 Mar 2006 03:14:10 -0500, "CMM" <cmm@nospam.com > wrote:
          [color=blue]
          >I have noticed this as well. "Auto-recognition" of declared variables has
          >been made stupider in VS2005. It worked great in VS2003. Option Strict and
          >Explicit all on here. I notice it all the time... but never bothered to
          >figure out why.
          >
          >I pretend "I didn't just see that".... considering this worked and has been
          >working great in VB for TEN years. And, now it doesn't.[/color]

          I haven't noticed it. I declare a variable with a certain case. Later
          on I use the variable using all lower case and when I leave the line
          it corrects the case. Are we talking about something else?

          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: Capitalize Variable Names

            "CMM" <cmm@nospam.com > schrieb:[color=blue]
            >I have noticed this as well. "Auto-recognition" of declared variables has
            >been made stupider in VS2005. It worked great in VS2003. Option Strict and
            >Explicit all on here. I notice it all the time... but never bothered to
            >figure out why.[/color]

            Same here. Sometimes VB 2005 doesn't automatically correct capitalization
            :-(((.

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • Cerebrus

              #7
              Re: Capitalize Variable Names

              Hi Larry,

              Usually VS does correct the case, but sometimes it "forgets". In such
              cases, just choose Edit -> Advanced -> Format Document, and that should
              correct it. Sometimes, saving the code also corrects the case.

              HTH,

              Regards,

              Cerebrus.

              Comment

              • Chris Dunaway

                #8
                Re: Capitalize Variable Names

                And a shortcut for that is Ctrl-K Ctrl-D

                Comment

                • Herfried K. Wagner [MVP]

                  #9
                  Re: Capitalize Variable Names

                  "Cerebrus" <zorg007@sify.c om> schrieb:[color=blue]
                  > Usually VS does correct the case, but sometimes it "forgets". In such
                  > cases, just choose Edit -> Advanced -> Format Document, and that should
                  > correct it. Sometimes, saving the code also corrects the case.[/color]

                  I've never needed this command in VB6, VB.NET 2002/2003. This is clearly a
                  bug that needs to be fixed!

                  --
                  M S Herfried K. Wagner
                  M V P <URL:http://dotnet.mvps.org/>
                  V B <URL:http://classicvb.org/petition/>

                  Comment

                  • CMM

                    #10
                    Re: Capitalize Variable Names

                    I wholeheartedly agree.

                    --
                    -C. Moya

                    "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                    news:OeV0ceAVGH A.4864@TK2MSFTN GP12.phx.gbl...[color=blue]
                    > "Cerebrus" <zorg007@sify.c om> schrieb:[color=green]
                    >> Usually VS does correct the case, but sometimes it "forgets". In such
                    >> cases, just choose Edit -> Advanced -> Format Document, and that should
                    >> correct it. Sometimes, saving the code also corrects the case.[/color]
                    >
                    > I've never needed this command in VB6, VB.NET 2002/2003. This is clearly
                    > a bug that needs to be fixed!
                    >
                    > --
                    > M S Herfried K. Wagner
                    > M V P <URL:http://dotnet.mvps.org/>
                    > V B <URL:http://classicvb.org/petition/>[/color]


                    Comment

                    • Phill  W.

                      #11
                      Re: Capitalize Variable Names

                      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                      news:OeV0ceAVGH A.4864@TK2MSFTN GP12.phx.gbl...[color=blue]
                      > "Cerebrus" <zorg007@sify.c om> schrieb:[color=green]
                      >> Usually VS does correct the case, but sometimes it "forgets". In such
                      >> cases, just choose Edit -> Advanced -> Format Document, and that should
                      >> correct it. Sometimes, saving the code also corrects the case.[/color]
                      >
                      > I've never needed this command in VB6, VB.NET 2002/2003. This is clearly
                      > a bug that needs to be fixed![/color]

                      Agreed,

                      but just how much /more/ processing power is that going to chew up? :-)

                      [Option Paranoia On]
                      Or, perhaps, this is the Thin End of the Wedge that will finally make VB
                      a Case-Sensitive language ...

                      ;-))

                      (I hope ...)

                      Regards,
                      Phill W.


                      Comment

                      • CMM

                        #12
                        Re: Capitalize Variable Names

                        > but just how much /more/ processing power is that going to chew up? :-)

                        Considering it worked just fine on a 486 DX-66 and Pentium 60 back in 1994,
                        I can't see why it should be a big deal today.

                        --
                        -C. Moya

                        "Phill W." <p-.a-.w-a-r-d@o-p-e-n.a-c.u-k> wrote in message
                        news:e0gut2$hff $1@yarrow.open. ac.uk...[color=blue]
                        > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                        > news:OeV0ceAVGH A.4864@TK2MSFTN GP12.phx.gbl...[color=green]
                        >> "Cerebrus" <zorg007@sify.c om> schrieb:[color=darkred]
                        >>> Usually VS does correct the case, but sometimes it "forgets". In such
                        >>> cases, just choose Edit -> Advanced -> Format Document, and that should
                        >>> correct it. Sometimes, saving the code also corrects the case.[/color]
                        >>
                        >> I've never needed this command in VB6, VB.NET 2002/2003. This is clearly
                        >> a bug that needs to be fixed![/color]
                        >
                        > Agreed,
                        >
                        > but just how much /more/ processing power is that going to chew up? :-)
                        >
                        > [Option Paranoia On]
                        > Or, perhaps, this is the Thin End of the Wedge that will finally make VB
                        > a Case-Sensitive language ...
                        >
                        > ;-))
                        >
                        > (I hope ...)
                        >
                        > Regards,
                        > Phill W.
                        >
                        >[/color]


                        Comment

                        • Homer J Simpson

                          #13
                          Re: Capitalize Variable Names


                          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                          news:OeV0ceAVGH A.4864@TK2MSFTN GP12.phx.gbl...[color=blue]
                          > "Cerebrus" <zorg007@sify.c om> schrieb:[color=green]
                          >> Usually VS does correct the case, but sometimes it "forgets". In such
                          >> cases, just choose Edit -> Advanced -> Format Document, and that should
                          >> correct it. Sometimes, saving the code also corrects the case.[/color]
                          >
                          > I've never needed this command in VB6, VB.NET 2002/2003. This is clearly
                          > a bug that needs to be fixed![/color]

                          And unless it's hidden, it's not in VB Express!



                          Comment

                          • Larry

                            #14
                            Re: Capitalize Variable Names

                            I tried it on and off, it didn't seem to make any difference.


                            Homer J Simpson wrote:[color=blue]
                            > "Larry" <bliff@Blifff.c om> wrote in message
                            > news:OpCzRY6UGH A.5172@TK2MSFTN GP12.phx.gbl...
                            >[color=green]
                            >> I am using VB.Net 2003, IDE.
                            >>
                            >> When I type a variable name that already has been Dim'd,
                            >> The IDE doesn't make the variable name Capitalized,
                            >> even though the variable name definition in the Dim is capitalized.
                            >>
                            >> VB 6 will do this.
                            >>
                            >> Where is the setting so that this will happen. Someone else here at work
                            >> uses VB.Net 2003, and his IDE does capitalize variables.[/color]
                            >
                            > Have you got Option Explicit on?
                            >
                            >
                            >[/color]

                            Comment

                            • Larry

                              #15
                              Re: Capitalize Variable Names

                              I have Whidbey (2005) on my another machine here at work,
                              and seems to work fine in regards to this issue.


                              CMM wrote:[color=blue]
                              > I have noticed this as well. "Auto-recognition" of declared variables has
                              > been made stupider in VS2005. It worked great in VS2003. Option Strict and
                              > Explicit all on here. I notice it all the time... but never bothered to
                              > figure out why.
                              >
                              > I pretend "I didn't just see that".... considering this worked and has been
                              > working great in VB for TEN years. And, now it doesn't.
                              >[/color]

                              Comment

                              Working...