dubem1 Posted February 2, 2005 Posted February 2, 2005 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 Quote
Leaders Iceplug Posted February 3, 2005 Leaders Posted February 3, 2005 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. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
NeuroMancerC Posted February 3, 2005 Posted February 3, 2005 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 Quote
dubem1 Posted February 4, 2005 Author Posted February 4, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.