HOWTO: Can you force a block like in C/C++/C# 
Author Message
 HOWTO: Can you force a block like in C/C++/C#

in one of the C's or Java you can force a block with {} is there someway to
do this in VB.NET? I don't want it for anything other than it makes a nice
way to indent the code. (I am writing LOTS of XML and it would be nice to
use blocks to help identify where I am ending sections etc)

If not I can always go to C#.

Thanks
Jeff



Tue, 01 Feb 2005 04:40:35 GMT  
 HOWTO: Can you force a block like in C/C++/C#
Jeff,

Quote:
>in one of the C's or Java you can force a block with {} is there someway to
>do this in VB.NET?

No.

Quote:
>I don't want it for anything other than it makes a nice way to indent the code.

Well, that you can do. Just select the code and hit Tab.

Quote:
>(I am writing LOTS of XML and it would be nice to
>use blocks to help identify where I am ending sections etc)

Can't you use comments for that?

' block starts here
...
' block ends here

Or, if you really like curlys

' {
...
' }

:-)

Mattias

===
Mattias Sj?gren (VB MVP)

http://www.msjogren.net/dotnet/



Tue, 01 Feb 2005 06:11:07 GMT  
 HOWTO: Can you force a block like in C/C++/C#

Quote:
> in one of the C's or Java you can force a block with {} is there
> someway to do this in VB.NET? I don't want it for anything other
> than it makes a nice way to indent the code. (I am writing LOTS
> of XML and it would be nice to use blocks to help identify where
> I am ending sections etc)

> If not I can always go to C#.

If True Then
    'block
End If

;-)

Armin



Tue, 01 Feb 2005 06:33:01 GMT  
 HOWTO: Can you force a block like in C/C++/C#
You could also use regions...


Quote:
> in one of the C's or Java you can force a block with {} is there someway
to
> do this in VB.NET? I don't want it for anything other than it makes a nice
> way to indent the code. (I am writing LOTS of XML and it would be nice to
> use blocks to help identify where I am ending sections etc)

> If not I can always go to C#.

> Thanks
> Jeff



Tue, 01 Feb 2005 06:54:12 GMT  
 HOWTO: Can you force a block like in C/C++/C#
You can't use regions in methods............ (tried that)

And to answer some of the other comments yes I can just use tabs to move
things in when you turn off the autoformatting. I was hoping there was a
nice way to leave autoformatting AND get blocks (without if True :) )

Thanks for the suggestions though.......


Quote:
> You could also use regions...



> > in one of the C's or Java you can force a block with {} is there someway
> to
> > do this in VB.NET? I don't want it for anything other than it makes a
nice
> > way to indent the code. (I am writing LOTS of XML and it would be nice
to
> > use blocks to help identify where I am ending sections etc)

> > If not I can always go to C#.

> > Thanks
> > Jeff



Tue, 01 Feb 2005 21:28:04 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Another CS-Realizer question

2. good VB website(s) for high school CS teacher??

3. CS-RCS with VB6

4. ANNOUNCE: CS-RCS Version 1.2

5. Announce: CS-RCS Version 1.1

6. Is VBPJ's HR program available on CS?

7. ANN: CS-RCS version 2.5 Released! (including DevStudio integartion)

8. GWBASIC - INPUT/ OPEN "COM1:600,N,8,2,RS,CS,DS,CD" as #1

9. Any way to prevent CR from auto-generating .cs file in VS.NET?

10. What diff between .NET C++ and .NET C# ?

11. VB vs C# vs C++

12. Howto block keyboard an mouse in vbscript

 

 
Powered by phpBB® Forum Software