Posting code examples to RTC Forums

I’ve been burned by BB tags [b] and [i] more than once when posting code examples to RTC Forums, so I thought this would be worth mentioning here.

When posting to RTC Forums, you will be editing your text in raw format. This gives you full control over the look of your post by allowing you to directly insert special “BB” tags ([i] …[/i] for italic, [b]..[/b] for bold, [u]…[/u] for underlined text, and so on). You can also use the toolbar, which is visible directly above the text entry area (when composing your Forum post) to insert BB tags around your currently selected text.

BB tags for text formatting are great when you want to make your text look better and easier to read (or insert images), but it can also be a nuisance when you wanted to post source code (which is often required to explain the question, or simply add more information about what you want to do), because the same letters used inside BB tags are often used in source code as for loop variables. For example, if you would simply copy/paste the following line as part of your post to the RTC Forums …
MyArray[i] := 1234.5678;
… without using any other BB tags to tell the Forum that you are posting code, it would end up looking like …
MyArray := 1234.5678;

Notice the missing [i] and the rest of the line italic?

To fix this problem and avoid confusion by the readers (making your code look “as intended”), you should select your code snippet and use the “Insert Code” button (#), which you can find in the Forum toolbar, directly above the text area.

By using the “Insert Code” button, a special BB code [ code ] (without spaces) will be inserted before your selected text (source code snippet) and the BB code [ /code ] (also without spaces) will be added directly after your selection. This special BB code tells the RTC Forum to ignore any BB tags inside your source code example and format it using a fixed width font.

This entry was posted in Articles, General on by .

About Danijel Tkalčec

I was born on March 2nd 1975 in Croatia, in a small town called Čakovec. I have started learning programming in 1985 (at the age of 10) on a Commodore 64, then moved on to  Amiga 500 a few years later, then to an IBM compatible "AT/XP" PC in high-school (1989), where I've been widening my knowledge to other programming languages like dBase, Clipper, Assembly, Quick Basic, Turbo Prolog and Turbo Pascal. After my high-school years, I did my duty and served the Army, working in the Administration and writing custom Applications for Data Management in Turbo Pascal. Returning home, I've continued using Turbo Pascal to develop custom Applications for local Businesses. Then, Microsoft Windows started taking over the World of IBM compatible PCs, and the company behind Turbo Pascal has released "Delphi" for Windows. The rest is history.