Jump to content

code without the text box?


Recommended Posts

You just post your code starting with "<?php" if it's php like this:

<?php
    session_start();
    $just = 'showing an example';
    $of = 'posting without a code box';
    $but = 'there is a problem<br>when trying to post<br>tags';
?>

My own preference is to see all posts in a [nobbc][code][/code][/nobbc] box. It make long lines and long posts much easier to read (IMHO).

Same post in the [nobbc][code][/nobbc]
[code]<?php
    session_start();
    $just = 'showing an example';
    $of = 'posting without a code box';
    $but = 'there is a problem<br>when trying to post<br>tags';
?>[/code]


Ken
Link to comment
Share on other sites

You mean like this?
[code=php:0]<?php
function count_to_one_hundred() {
    for($i=1; $i<=100; $i++) echo "$i<br/>";
}
count_to_one_hundred();
?>[/code]

You just enclose your code in [php[b][/b]][/php[b][/b]] tags. Although, I too would prefer to see code within the [code[b][/b]] tags, mainly because I prefer to read code with fixed width characters. It looks neater that way.
Link to comment
Share on other sites

i imagine there's a good reason it doesn't scroll the text, and that's because if it did so it would be a pain in the *insert body part of choice here* for us to count the lines (god forbid someone actually tell us what line x is).
Link to comment
Share on other sites

There's an easy way to post code without using the code box - just use [nobbc][pre][/pre][/nobbc]. This will preserve spacing/formatting and also display things in an easy-to-read fixed-width font. If you do this though, you should also make sure to select the "Don't use smileys." option under "Additional options..." on the main post screen so that your code won't end up having smileys scattered throughout it.

The horizontal scrolling is done to prevent extra-wide code from stretching out the rest of the page, which is really annoying, especially for those using the dreaded 800x600 resolution...

As akitchin stated, word-wrapping within the code box would make things extremely difficult to read and would make it hard to find specific lines without copying the code and pasting it into notepad or another text editor.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.