-
1. Formatting in the Forum
ehenne Jan 20, 2003 9:09 AM (in response to ehenne)With some more research I found interesting undocumented formatting features for the forum.
I have always missed a possibility to show code with indentation and in fixpoint font. Here is the solution: Just enclose your code with [pre] and [/pre]. Here is an example:
----------------------------------------------------------------------------------
Following is some example code to show code formatting capabilities:
[pre]package example;
public class [b]ExampleClass[/b] {
    public [b]someMethod[/b] (String s) {
        if (s&#91i] > " ") {
            doSomething ("useful");
[/pre]And here is some more text following the code.
----------------------------------------------------------------------------------
The above source text will then be formatted as:
----------------------------------------------------------------------------------
Following is some example code to show code formatting capabilities:
[pre]package example;
public class ExampleClass {
public someMethod (String s) {
if (s[i] > " ") {
doSomething ("useful");
[/pre]And here is some more text following the code.
----------------------------------------------------------------------------------
As you see we can still use the other formatting codes like [b][/b] etc. But I noticed that we need at least one space in empty lines because elsewhere they would disappear inside a pre-block.
You might wonder how I managed to show you the source text above with disabled formatting. The trick is to use another undocumented feature: We can use the HTML replacement characters starting with "&" in our messages. Especially useful is &nbsp for non breaking spaces to keep the indentation. In the above examples I used &#91 for "[" and &amp for "&" to prevent any formatting. See http://msdn.microsoft.com/workshop/author/dhtml/reference/charsets/charsets.asp for a complete list of replacement codes. -
2. Re: Formatting in the Forum
ehenne Jan 22, 2003 9:37 AM (in response to ehenne)I have noticed that the above message does not look good on Netscape as it requires a closing ";" after the "&" replacement codes. So I repost my above post with semicolons to make it look good also with Netscape and hopefully other browser. I am really missing a possibility to edit old messages :-)
With some more research I found interesting undocumented formatting features for the forum.
I have always missed a possibility to show code with indentation and in fixpoint font. Here is the solution: Just enclose your code with [pre] and [/pre]. Here is an example:
----------------------------------------------------------------------------------
Following is some example code to show code formatting capabilities:
[pre]package example;
public class [b]ExampleClass[/b] {
public [b]someMethod[/b] (String s) {
if (s[i] > " ") {
doSomething ("useful");
[/pre]And here is some more text following the code.
----------------------------------------------------------------------------------
The above source text will then be formatted as:
----------------------------------------------------------------------------------
Following is some example code to show code formatting capabilities:
[pre]package example;
public class ExampleClass {
public someMethod (String s) {
if (s[i] > " ") {
doSomething ("useful");
[/pre]And here is some more text following the code.
----------------------------------------------------------------------------------
As you see we can still use the other formatting codes like [b][/b] etc. But I noticed that we need at least one space in empty lines because elsewhere they would disappear inside a pre-block.
You might wonder how I managed to show you the source text above with disabled formatting. The trick is to use another undocumented feature: We can use the HTML replacement characters starting with "&" in our messages. Especially useful is   for non breaking spaces to keep the indentation. In the above examples I used [ for "[" and & for "&" to prevent any formatting. See http://msdn.microsoft.com/workshop/author/dhtml/reference/charsets/charsets.asp for a complete list of replacement codes.