How to paste code in forums
Hi,
Is there somewhere a short description on how to paste a code in the forums?
I understand that the media has limitations, but I am sure that it is possible to come-up with some guidlines on doing code correctly.
Currently it takes lots of time to format the code if you want to look it properly.
Max
I’ve had the most luck with pasting from Visual Studio into Word and then copying the new text from Word into the message window on the forum. Granted there is that extra step involved of Word, it does save a huge amount of time in trying to format it more like it was in Visual Studio.
I'm doing the same steps, except that instead of using Microsoft Word, I use Frontpage editor instead. Copy codes from Visual Studio to Frontpage editor, then copy it again and paste it to the text editor of this forum.
Regards,
-chris
Pasting directly from VS works fine so long as I use IE (IETab, specifically). FF loses the formatting. FF is much better at regular posts, though -- I never run into the strange problems where adding a line break makes all my text turn into 3pt font.
This mostly works, but there seems to be a bug in how the forums handle code inside PRE tags. I posts some code this way, and later noticed that C++ stype casts (reinterpret_cast, const_casts) had been mangled (the target type between angle brackets didn't show up). I suspect code using templates might have the same problem.
This line
const_cast(var);
was entered inside PRE tags with HTML visable as
const_cast<char *>(var);
but that is not how it appears!