Code tags bug

This is a discussion on Code tags bug within the A Brief History of Cprogramming.com forums, part of the Community Boards category; The bugs thread is so large I thought I would post this here: The following code turns the italics on ...

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598

    Code tags bug

    The bugs thread is so large I thought I would post this here:

    The following code turns the italics on even when inside of a code block.

    for (int i=0;i<static_cast<int>(m_vVector.size());i++)
    {
    delete m_vVector[i];
    }

    //This is a test of italics.

    Proof.

    Code:
    for (int i=0;i<static_cast<int>(m_vVector.size());i++)
    {
      delete m_vVector[i];
    }
    
    //This is a test of italics.
    Hmm it didn't do it here. It did in one of my other threads.
    CTabCtrl not receiving messages

    Notice the line in the destructor for CMyTabCtrl. It should be

    delete m_vWnds[i];

    Instead it read it as 'italics on'.
    Last edited by VirtualAce; 06-04-2006 at 07:23 PM.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Its because vBlah parses BBC inside of code tags. Its really annoying IMO.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Why does it only occur at certain times?

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    In the code that caused it did you by chance have more then one bbc "tag" in it, or something that would look like a closing tag??

    Lets test some of them out

    Code:
    blarg [i]blah
    Code:
    blarg [i]blah[b]meh
    Code:
    blarg [i]blah"[/u]"

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,077
    Code:
    arry; // This should read *(arry + i) in subscript form

    Before this statement I open an italic.

    Before this statement I close an italic.

    The [/i], though, closes the first [i] it sees, not the last. The first being the subscript operator in the code. Your problem is that you decided to put italics at the end of your post. Note that [i] at the beginning of your last paragraph.

    The only way I can think to fix this is to put italics tags around your subscript operator only and negate them.
    Code:
    arry[i]; // No more italics here.
    Or you could just use 'j' as your count variable instead of 'i'.
    Last edited by SlyMaelstrom; 06-05-2006 at 02:22 AM.
    Sent from my iPad®

  6. #6
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Code:
    for (int i=0;i<static_cast<int>(m_vVector.size());i++)
    {
      delete m_vVector[i];
    }
    
    //This is a test of italics.
    Some normal text.

    Some italics at the end.


    Some normal text. I cannot belive they still have bugs like this.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #7
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    This software costs money. This is unacceptable.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  8. #8
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    The typical workaround I use is to use code like [[color=black]i[/color]] for these things - it's the same I use when demonstrating tags. (Which makes what I just posted a monster.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #9
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    As much as I hate defending vBulletin, this site is running an old version, and its possible that a newer one has fixed these issues.

  10. #10
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    498
    Is there anything seriously wrong with phpBB?

  11. #11
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    yes :P

  12. #12
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    498
    yes :P
    What?

  13. #13
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    Quote Originally Posted by joeprogrammer
    What?
    It's free. It can't be good.

    ...

  14. #14
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    And it does not look like this board. Change is bad.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. don't know to use code tags
    By giovs in forum C Programming
    Replies: 1
    Last Post: 10-12-2004, 07:51 AM
  2. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Windows Programming
    Replies: 0
    Last Post: 10-14-2002, 02:29 PM
  3. about code tags
    By ygfperson in forum C++ Programming
    Replies: 9
    Last Post: 04-06-2002, 05:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21