Small Basic Forum: Code Blocks
In this article, I will explain how to use Nonki Takahashi's Code Block Interpreter to make code blocks in forums. When importing and running SKC235-1 in the SB UI, you should be greeted with this window:
So first, you copy/paste your code into the 'Paste source code below' box. The default options are pretty good, and unless you know what you're doing, I would keep them at their current values. I often click 'Preview' just to be sure that it looks good and that no big bug happened (I've never seen one occur yet, though =^) ) . So after doing that, you can click the 'OK' button. After it finishes processing your code, you should see a giant string of HTML. Those new to programming, don't freak out! It should look something like this.
So, basically, just copy all of that. Then comes the harder part. Putting it into your forum post. Everything you see in web browsers is probably run in HTML or other markup languages. This is your code block in HTML. To use this HTML code, you go to the forum you wanted to post on, and when you're posting, you'll probably see this:
Pushing this will allow you to edit the HTML of your post. In this case, we push it. This is what the HTML of a short post may look like:
You see where the </p> is? Careful, we don't want the <p>! After that </p> is where we put our code block. So just paste, press 'Update,' and you should see your code block. Ta-Da!
NOTE:
If it gets scrunched up like this, and you don't want that, you can go back to the Code Block Generator and make the 'Max Snippet Width' higher by about 100 to 150.
NOTE:
I wouldn't check the 'Display Line Numbers' box because if you do that, it will count the line numbers as part of the code in the end result. So then, others could end up having to erase all the line numbers after they paste into SB. That would be bad.
See Also