8 Replies - 6111 Views - Last Post: 13 August 2011 - 03:26 PM Rate Topic: -----

#1 littlebigman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 09-February 10

[VB.Net Express 2008] Disable auto-indenting?

Posted 09 February 2010 - 07:56 AM

Hello

I'm a VB.Net newbie and have a question about how to disable this annoying auto-indenting in VB.Net Express 2008:

        'POST
        If PostData.Length > 0 Then
            'GET
        Else
            Dim Response As HttpWebResponse = Request.GetResponse()




Can the IDE be told to ignore this type of line and leave it as is so I can have "'GET" aligned with the Else block?

Thank you.

Is This A Good Question/Topic? 0
  • +

Replies To: [VB.Net Express 2008] Disable auto-indenting?

#2 snikmotnairb  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 70
  • Joined: 02-May 08

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 09 February 2010 - 10:45 AM

Have you checked under:

Debug -> Tools -> Options -> Text Editor

If it's possible, then you would probably be able to set it there.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Trent Jackson*


Reputation:

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 09 February 2010 - 02:21 PM

Why would you want to disable auto indent for?

It is the best thing that Microsoft have ever done to be quite factual.

Code is unreadable if it is not indented.

The majority of VB6 code on the web is not indented.

Manually indenting code in VB6 is cumbersome, particularly if you need to make changes to a large procedure with many nested levels. 20 IFs inside an IF, 20 loops inside a loop.

Very time consuming.
Was This Post Helpful? -1

#4 littlebigman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 09-February 10

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 10 February 2010 - 04:09 AM

I like auto-indenting... except in this particular case where the comment ends up lined up with the previous block instead of the following line :-/

Too bad. Thanks for the help anyway.
Was This Post Helpful? 0
  • +
  • -

#5 Guest_John Reynolds*


Reputation:

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 23 February 2010 - 08:18 AM

View Postlittlebigman, on 09 February 2010 - 06:56 AM, said:

[snip]
Can the IDE be told to ignore this type of line and leave it as is so I can have "'GET" aligned with the Else block?

Thank you.


Previous annoying "why would you want to do that?" post should be ignored. That poster should have realized that automatic indenting that works is useful, but if it doesn't work, you're allowed to be annoyed. Why is it that one of the first responses to any programming question is "Why would you want to do that?"

Go to Tools|Options|Text Editor|Basic|Tabs. Set indenting from Smart to Block. This fixed my very annoying and similar problem.

John
Was This Post Helpful? 2

#6 Guest_Ted*


Reputation:

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 03 March 2010 - 03:34 PM

I have the auto-indent checkbox unchecked, yet still getting some annoying auto-formatting in VB6.

I have code that looks like:

frmMask.Left = GetSetting(App.Title, "Settings", "MaskMainLeft", default)
frmMask.Top = GetSetting(App.Title, "Settings", "MaskMainTop", default)

Now good coding style says to make it look like:

frmMask.Left = GetSetting(App.Title, "Settings", "MaskMainLeft", default)
frmMask.Top = GetSetting(App.Title, "Settings", "MaskMainTop", default)

Thus making it much more readable. VB6 keeps deleting my alignment spaces! Anyone know how to turn off this "feature"?

Also, anyone know how to get 4 spaces instead of tabs in VB6? I hate tabs in code. I even wrote a short program to remove all tabs from text files and replace them with 4 spaces. At least VC++ lets you turn off these automagical annoyances.

Thanks
Was This Post Helpful? 0

#7 Guest_Ted*


Reputation:

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 03 March 2010 - 03:39 PM

Oh no! The reply on this website reformated my example too!

Here it is with underscores instead of spaces. It will likely look funny in a variable width font, so if you don't believe me, copy them both into a fixed-font editor, and replace the underscores with spaces.

VB6:

frmMask.Left_=_GetSetting(App.Title,_"Settings",_"MaskMainLeft",_default)
frmMask.Top_=_GetSetting(App.Title,_"Settings",_"MaskMainTop",_default)

the way it should look:

frmMask.Left_=_GetSetting(App.Title,_"Settings",_"MaskMainLeft",_default)
frmMask.Top__=_GetSetting(App.Title,_"Settings",_"MaskMainTop",__default)
Was This Post Helpful? 0

#8 Gopher2011  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-March 11

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 06 July 2011 - 09:03 AM

VB is a fast easy straight forward coding base. People want to do code fast. 99/100 prefer the auto-format. I know I wish C# had it on default.

However I agree with you this looks better - its an annoyance.

frmMask.Left_=_GetSetting(App.Title,_"Settings",_"MaskMainLeft",_default)
frmMask.Top__=_GetSetting(App.Title,_"Settings",_"MaskMainTop",__default)

This post has been edited by Gopher2011: 06 July 2011 - 09:03 AM

Was This Post Helpful? 0
  • +
  • -

#9 littlebigman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 09-February 10

Re: [VB.Net Express 2008] Disable auto-indenting?

Posted 13 August 2011 - 03:26 PM

[quote name='John Reynolds' date='23 February 2010 - 08:18 AM' timestamp='1266938287' post='936228']Go to Tools|Options|Text Editor|Basic|Tabs. Set indenting from Smart to Block. This fixed my very annoying and similar problem.

Thanks John for the tip.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1