Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I have some code templates I used. In those templates, I replace some tags with code. I then create a new .vb file. But sometimes, because of where the tags are in the template, the resulting code is not always well indented.

 

I know I can do CTRL+KD in VS.NEt to reindent the code but i would like to do it before. I would like to indent my code just before I save it into a .vb file.

 

Do you know a way to indent a text file?? (because in fact it is a text file with a .vb extention)

 

Thank you

Martin Dube

  • Leaders
Posted

So, you have an application with a textbox in it that you want to indent like VS.NET does (which is pretty complex)?

You'd probably have to parse the code yourself, spotting keywords on newlines and such until you find something like an If Then or End If... (and vb is harder to parse than c#, imo). This sounds like quite the project if you attempt it. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

What bugs me more is: WHY would you want to do that? Stick it into vb, and have it indented, thereafter you can just copy and paste.

 

*shrug* perhaps i'm missing the plot entirely.

 

 

Hello,

 

I have some code templates I used. In those templates, I replace some tags with code. I then create a new .vb file. But sometimes, because of where the tags are in the template, the resulting code is not always well indented.

 

I know I can do CTRL+KD in VS.NEt to reindent the code but i would like to do it before. I would like to indent my code just before I save it into a .vb file.

 

Do you know a way to indent a text file?? (because in fact it is a text file with a .vb extention)

 

Thank you

Martin Dube

Posted
What bugs me more is: WHY would you want to do that? Stick it into vb, and have it indented, thereafter you can just copy and paste.

 

*shrug* perhaps i'm missing the plot entirely.

 

Because I have an application generating vb.net code. This application creates a .vb file. But I am not able to generate de code well indented. The only way I have found to indent it well is to open the .vb file ins VS.NET and the do a CRTL+KD and then save the file.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...