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! ;-)
IT Analyst Programmer
Wespine Industries Pty Ltd
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
CADalyst's AutoCAD Clinic
Rand IMAGINiT Technologies
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: http://www.autodesk.com/discussiongroup-help 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: http://discussion.autodesk.com/thread.jspa?threadID=321400
Note: the negative side effect of this is that the "pre" tags display in the nntp view.
Discussion Groups Manager