Thread: Code-Coloring

  1. #1
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    Code-Coloring

    Guys, what about a code-coloring script to the forum?
    This will be very nice for posting source-code, and it's not difficult to build something like that. What you guys think about this idea?

    Hmm, the script could be Client-side or server-side no matter...

    Look an example:
    Code:
    #include <stdio.h>
    #define FOO 10
    
    int main(void)
    {
        char foo; 
        int  foo2;
    
        printf("This is green");
         
       for (foo2 = 0; foo2 <= 10; ++foo2) 
            printf("%d\n",foo2);
            
           return 0; //comment here, return ok 
    
    }

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    You mean like the PHP tag?

    PHP Code:
    #include <stdio.h>
    #define FOO 10

    int main(void)
    {
        
    char foo
        
    int  foo2;

        
    printf("This is red");
         
       for (
    foo2 0foo2 <= 10; ++foo2
            
    printf("%d\n",foo2);
            
           return 
    0//comment here, return ok 


    I think that the PHP tag is insanely ugly, though. I want to shoot anyone who uses it.

  3. #3
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    close to the php tags..

    but specially designed to C/C++ source code.
    the php tag is so ugllyyyyyyyyyyyy

  4. #4
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Actually i wouldn't mind it, my compiler window is color customized so i can better read it.

  5. #5
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198
    I agree, it would really help for readability, although the PHP one doesnt seem too bad to me.

    I dont always use it, but had it setup for Java, and and HTML editor, comes in handy sometimes .
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  6. #6
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    The PHP tag tends to be very wide....

  7. #7
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    I started work on one last week, it's fairly complete. Between it and another project i'm working on, it should be done sometime soon... I'll post it.

    Sunlight made one, you can get it on his website (www.sunlightd.com)

  8. #8
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807

    Eibro, if you need some-help.

    Maybe I can help you. You're building one server-side or user-side?

    Hmm, Once I did a nice code-coloring to DCForum's, in JS and PHP.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 07:34 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM