none
Improve formatting of code samples in this forum RRS feed

  • General discussion

  • Wouldn't it be nice to have properly formatted code blocks in this forum?

    1. It's a nightmare trying to post code, and if you ever need to edit your post, the code sample gets horribly messed up.
    2. No preview to see how it will look before posting - remember it has to be right first time as editing as difficult .
    3. The code sample blends with the rest of the text (e.g. font face and size is the same), so it makes the whole post look messy.

    It's not a piece of cake, but maybe MSFT have the programmers who can do a bit of HTML formatting...

    Here's an example of what I would like to see, although not too bothered if PHP-specific syntax is coloured correctly or not:

    <?php
    function PutVersion($conn )
    {
        if ( !$conn )
        {
            echo 'Bad connection: ' . print_r(sqlsrv_errors(),true );
        }
        else
        {
            $client = sqlsrv_client_info($conn );
            $server = sqlsrv_server_info($conn );
            echo <<<TXT
    SQL Server : {$server['SQLServerVersion' ]}
    Client DLL : {$client['DriverDllName' ]}
    Client ODBC : {$client['DriverODBCVer' ]}
    Client Driver : {$client['DriverVer' ]}
    Client Ext. : {$client['ExtensionVer' ]}
     
    TXT;
        }
    }
    ?>
    Does anyone agree?
    Rob
    • Moved by Ashay Chaudhary [MSFT] Saturday, January 22, 2011 3:08 AM Feedback on post editing/code syntax capability (From:SQL Server Driver for PHP)
    Wednesday, January 19, 2011 11:08 AM

All replies

  • Yes, I agree with you. I hate an editor that transform my post without tell me
    Thursday, February 3, 2011 9:35 AM
  • Agree.
    Thursday, February 3, 2011 3:50 PM
  • Wouldn't it be nice to have properly formatted code blocks in this forum?

    Isn't that what the  Insert Code Block  button is supposed to do?

    BTW  Answers forums don't even have that.   ; )

     

    ---

    Friday, February 4, 2011 4:06 AM
  • Isn't that what the  Insert Code Block  button is supposed to do?

    ---

    Have you already use this button? it is inusable (principaly on the edition of a post)
    Friday, February 4, 2011 7:33 AM
  • Isn't that what the  Insert Code Block  button is supposed to do?

    ---

    Have you already use this button? it is inusable (principaly on the edition of a post)

    <?php 
    function PutVersion($conn )
    {
     if ( !$conn )
     {
     echo 'Bad connection: ' . print_r(sqlsrv_errors(),true );
     }
     else 
     {
     $client = sqlsrv_client_info($conn );
     $server = sqlsrv_server_info($conn );
     echo <<<TXT 
    SQL Server : {$server['SQLServerVersion' ]} 
    Client DLL : {$client['DriverDllName' ]} 
    Client ODBC : {$client['DriverODBCVer' ]} 
    Client Driver : {$client['DriverVer' ]} 
    Client Ext. : {$client['ExtensionVer' ]} 
     
    TXT; 
     }
    }
    ?>
    
    


    So, I did an Insert of the OP's PHP sample.   It looks Ok?   Is the problem going to show up after a Submit?...

    Post submit: <voice Actor="Emily Litella"> Never mind! </voice>

    Friday, February 4, 2011 5:35 PM