For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > April 2006 > Can VB auto Indent a whole block code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can VB auto Indent a whole block code
hon123456

2006-04-27, 9:56 pm

Dear all,

I have write some code as follows which is not indented:

if ......
if....
for i = 1 to 10
.....
next i
end if
else
end if

Can I select all the code and press one short cut key to let
VB to indent the code as follows:

if ......
if
for i = 1 to 10
.....
next i
end if
else
.....
end if

That means can VB auto indent?

Thanks.

Ralph

2006-04-27, 9:56 pm


"hon123456" <peterhon321@yahoo.com.hk> wrote in message
news:1146191824.100622.153660@v46g2000cwv.googlegroups.com...
> Dear all,
>
> I have write some code as follows which is not indented:
>
> if ......
> if....
> for i = 1 to 10
> .....
> next i
> end if
> else
> end if
>
> Can I select all the code and press one short cut key to let
> VB to indent the code as follows:
>
> if ......
> if
> for i = 1 to 10
> .....
> next i
> end if
> else
> .....
> end if
>
> That means can VB auto indent?
>
> Thanks.
>


VB uses what some call "smart indention" ie, it will attempt to match
previous indents, but it will not go back and adjust previous spacings.

There are various beautifiers and indentors available as either Addins or
separate editors. Use one of those.

-ralph


Michael C

2006-04-27, 9:56 pm

"hon123456" <peterhon321@yahoo.com.hk> wrote in message
> Can I select all the code and press one short cut key to let
> VB to indent the code as follows:


All you can do is select multiple lines and push tab or shift tab.

.... or ugrade to .net :-)

Michael


Jeff Johnson

2006-04-27, 9:56 pm


"hon123456" <peterhon321@yahoo.com.hk> wrote in message
news:1146191824.100622.153660@v46g2000cwv.googlegroups.com...

> Can I select all the code and press one short cut key to let
> VB to indent the code as follows:


VB does not provide this out-of-the-box.


Nospam

2006-04-28, 3:56 am


"Michael C" <nospam@nospam.com> wrote in message
news:%2368HFPnaGHA.508@TK2MSFTNGP02.phx.gbl...
> "hon123456" <peterhon321@yahoo.com.hk> wrote in message
>
> All you can do is select multiple lines and push tab or shift tab.
>
> ... or ugrade to .net :-)
>
> Michael
>
>


Then this will be the least of your worries!!!


S. I. Becker

2006-04-28, 7:56 am

Michael C wrote:
> ... or ugrade to .net :-)


"ugrade"

In the British examinations system - GCSEs and 'A' levels - a Grade of
U, or U Grade, is the grade meaning "failed".

Stewart

(who's avoided posting on the .NET debate for 2 months now and thinks
that must be a personal record, but just couldn't resist today.)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com