Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Multi-language code block

Multi-language code block

Scheduled Pinned Locked Moved Site Bugs / Suggestions
csharpc++tutorialquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #1

    I am currently writing an article which has both VB and C# code which does exactly the same. I need to show lots of code examples and posting two code blocks for each example makes the article even longer than it already is. Is it possible to do something like on MSDN where you have one code block with tabs [C#][C++][F#][VB][Insert language here]? This is the second article I am writing this way and I haven't heard any complaints in the first article, but it would still be great :)

    It's an OO world.

    public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }
    }

    K 1 Reply Last reply
    0
    • Sander RosselS Sander Rossel

      I am currently writing an article which has both VB and C# code which does exactly the same. I need to show lots of code examples and posting two code blocks for each example makes the article even longer than it already is. Is it possible to do something like on MSDN where you have one code block with tabs [C#][C++][F#][VB][Insert language here]? This is the second article I am writing this way and I haven't heard any complaints in the first article, but it would still be great :)

      It's an OO world.

      public class Naerling : Lazy<Person>{
      public void DoWork(){ throw new NotImplementedException(); }
      }

      K Offline
      K Offline
      kid sister
      wrote on last edited by
      #2

      Clickety[^] I need the same thing for my Tip/Trick.

      xoxo
      Kid sister :rose: There's no place like Lounge - Me

      Sander RosselS 1 Reply Last reply
      0
      • K kid sister

        Clickety[^] I need the same thing for my Tip/Trick.

        xoxo
        Kid sister :rose: There's no place like Lounge - Me

        Sander RosselS Offline
        Sander RosselS Offline
        Sander Rossel
        wrote on last edited by
        #3

        Ah, hadn't seen that... :-O Well, consider this a bump then ;)

        It's an OO world.

        public class Naerling : Lazy<Person>{
        public void DoWork(){ throw new NotImplementedException(); }
        }

        A 1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          Ah, hadn't seen that... :-O Well, consider this a bump then ;)

          It's an OO world.

          public class Naerling : Lazy<Person>{
          public void DoWork(){ throw new NotImplementedException(); }
          }

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          It doesn't need a bump, as they have implemented it already. Take a closer look at the resplies to the message that was linked to. :)

          Thou mewling ill-breeding pignut!

          Sander RosselS 1 Reply Last reply
          0
          • A AspDotNetDev

            It doesn't need a bump, as they have implemented it already. Take a closer look at the resplies to the message that was linked to. :)

            Thou mewling ill-breeding pignut!

            Sander RosselS Offline
            Sander RosselS Offline
            Sander Rossel
            wrote on last edited by
            #5

            string reply = @"So you're saying I can already have tabbed code blocks?";

            Dim reply As String = "That's so awesome!!!"

            I don't think I'm getting it... :~

            It's an OO world.

            public class Naerling : Lazy<Person>{
            public void DoWork(){ throw new NotImplementedException(); }
            }

            A 2 Replies Last reply
            0
            • Sander RosselS Sander Rossel

              string reply = @"So you're saying I can already have tabbed code blocks?";

              Dim reply As String = "That's so awesome!!!"

              I don't think I'm getting it... :~

              It's an OO world.

              public class Naerling : Lazy<Person>{
              public void DoWork(){ throw new NotImplementedException(); }
              }

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #6

              See Call Functions Until One Meets Condition, which shows an example. Let me see if it works here (in the forums):

              // Hello, world.

              ' Hello, world.

              Thou mewling ill-breeding pignut!

              Sander RosselS 1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                string reply = @"So you're saying I can already have tabbed code blocks?";

                Dim reply As String = "That's so awesome!!!"

                I don't think I'm getting it... :~

                It's an OO world.

                public class Naerling : Lazy<Person>{
                public void DoWork(){ throw new NotImplementedException(); }
                }

                A Offline
                A Offline
                AspDotNetDev
                wrote on last edited by
                #7

                Based on my above test, it works in tips, but not in the forums. EDIT: Also, it doesn't work in the tips preview, but it does work when the tip is published.

                Thou mewling ill-breeding pignut!

                1 Reply Last reply
                0
                • A AspDotNetDev

                  See Call Functions Until One Meets Condition, which shows an example. Let me see if it works here (in the forums):

                  // Hello, world.

                  ' Hello, world.

                  Thou mewling ill-breeding pignut!

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #8

                  Nice tip, but what am I supposed to see? I don't see tabbed code blocks and clicking on (C# Version) only changes the url of the page...

                  It's an OO world.

                  public class Naerling : Lazy<Person>{
                  public void DoWork(){ throw new NotImplementedException(); }
                  }

                  A 1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    Nice tip, but what am I supposed to see? I don't see tabbed code blocks and clicking on (C# Version) only changes the url of the page...

                    It's an OO world.

                    public class Naerling : Lazy<Person>{
                    public void DoWork(){ throw new NotImplementedException(); }
                    }

                    A Offline
                    A Offline
                    AspDotNetDev
                    wrote on last edited by
                    #9

                    Oops, I must have linked to the alternate. Go to the main tip. The alternate's links no longer work because they were put in place in the old tip/trick system. In fact, I'll be deleting the alternate once a certain bug (unplanned feature) is fixed.

                    Thou mewling ill-breeding pignut!

                    Sander RosselS 1 Reply Last reply
                    0
                    • A AspDotNetDev

                      Oops, I must have linked to the alternate. Go to the main tip. The alternate's links no longer work because they were put in place in the old tip/trick system. In fact, I'll be deleting the alternate once a certain bug (unplanned feature) is fixed.

                      Thou mewling ill-breeding pignut!

                      Sander RosselS Offline
                      Sander RosselS Offline
                      Sander Rossel
                      wrote on last edited by
                      #10

                      Oh, nice! Exactly what I need for my newest article[^]! :D Thanks for the tip!

                      It's an OO world.

                      public class Naerling : Lazy<Person>{
                      public void DoWork(){ throw new NotImplementedException(); }
                      }

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups