Visual Basic Customization

Visual Basic Customization

Distinguished Contributor
Posts: 467
Registered: ‎12-11-2003
Message 1 of 4 (57 Views)

Tip for viewing code in this web forum

57 Views, 3 Replies
03-16-2004 05:54 PM
As most of you are probably aware the new web interface in this forum does not faithfully reproduce indentation which is a pain when trying to understand the code somebody has posted. (In fairness to the web administrators this appears to be a function of the way HTML treats multiple spaces.)

Selecting and copying the code off the web page and pasting it into something like Notepad produces the same result. However the HTML source does hold the indentation, so with a bit of mucking around you can reformat the code as the originator intended. Unfortunately I couldn't make this work in Notepad, so you need to get yourself an editor with a smarter Replace function like TextPad.

1. Open the HTML source for the post. In Internet Explorer do this by right-clicking the page and choosing View Source which will open it in Notepad.
2. Use the Find command to locate the beginning of the code block you want.
3. The code continues straight across the one line but eventually wraps to the next line(s) so you'll probably need to scroll across to find the end of the code. Hold down Shift and click at the end of the code to select the whole code block, then copy it to the clipboard.
4. Switch to your smarter editor and paste in the code.
5. Replace the HTML line-break tag with a newline. In TextPad you do this by saying Find "
", Replace with "\n" and ticking the Regular Expression box.
6. Grab your lemonade, sit back, and leisurely view the formatted code! ;-)


Wayne Ivory
IT Analyst Programmer
Wespine Industries Pty Ltd
*Mike Tuersley
Message 2 of 4 (57 Views)

Re: Tip for viewing code in this web forum

03-16-2004 08:09 PM in reply to: wivory
Cool, Wayne! You could also use PFE - Professional File Editor [which is free, not sure about TextPad]. With it you can create/store/run your own macros for the find/replace in step 5 - I'm lazy that way:smileyhappy: Mike -- ___________________________ Mike Tuersley CADalyst's AutoCAD Clinic Rand IMAGINiT Technologies
*James Belshan
Message 3 of 4 (57 Views)

Re: Tip for viewing code in this web forum

03-16-2004 08:32 PM in reply to: wivory
Or, in the ubiquitous MS Word, step 5 would be replace
with ^p James
Distinguished Contributor
Autodesk-Eric Wright
Posts: 123
Registered: ‎12-14-2003
Message 4 of 4 (57 Views)

Re: Tip for viewing code in this web forum

03-17-2004 10:49 AM in reply to: wivory
You're right about the limits of html and how it treats multiple spaces. However, there are a few additional tips in the help section: listed under
How do I include formatted code snippets in my message?

1. Attach code samples (all forums now allow attachments)
2. Use pre tags around code (see help for syntax)

See my test post as an example of the results using pre tag:

Note: the negative side effect of this is that the "pre" tags display in the nntp view.

Eric Wright
Discussion Groups Manager
Autodesk, Inc.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.