How To Attach Source Code To Your Forum Posts
PHP Code:
Attaching source code is done by copy-and-paste. However, you need
to do a special procedure. When pasting source code in your posts in the
Developer Forum, don't forget to put a "xxx91;codexxx93;" at the beginning of your
source code, and then a "xxx91;/codexxx93;" at the end of your source code. This
prevents the forum system from messing up your source code.
Example #1: Messy Paste
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;
public HelloWorld() {
exitCommand = new Command("Exit", Command.EXIT, 1);
tbox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}
protected void startApp() {
Display.getDisplay(this).setCurrent(tbox);
}
protected void pauseApp() {}
protected void destroyApp(boolean bool) {}
public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
Example #2: Correctly Done Paste
PHP Code:
xxx91;codexxx93;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;
public HelloWorld() {
exitCommand = new Command("Exit", Command.EXIT, 1);
tbox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}
protected void startApp() {
Display.getDisplay(this).setCurrent(tbox);
}
protected void pauseApp() {}
protected void destroyApp(boolean bool) {}
public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
xxx91;/codexxx93;