0

I'm confused (not an uncommon state lately, I'm afraid). A short time ago I posted some VB code using the CODE button. In response I was told by pyTony that I should be using fences. Today when I went to post some code, the posing area had a large banner stating

If posting a code snippet, use the Code button in the editor toolbar

Can someone please state, definitively, what is the preferred method for posting code?

4
Contributors
10
Replies
11
Views
5 Years
Discussion Span
Last Post by Dani
Featured Replies
  • 1
    Dani 1,665   5 Years Ago

    The syntax highlighter is geared towards C/C++/Java-style languages and color-code VB/Python code optimally. For example, it doesn't recognize comments in code. In the near future, code posted in those forums will know to use syntax highlighters specifically for the specified language. Read More

  • ~s.o.s~ Specifically, single quotes tended to screw up the display. Single line comments (beginning with a single quote) or line ending comments (again with a single quote). Here's an example Private Sub mnuLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLoad.Click 'prompt for a file name and load the … Read More

0

The new Code button is easier to use than ~~~ tags (less typing) As far as I can tell ~~~ doesn't work any more.

Edited by Ancient Dragon

0

Can someone please state, definitively, what is the preferred method for posting code?

Fenced blocks were removed because as quoted by Dani, "they were incredibly buggy". The preferred way to post code is to indent the code by 4 spaces (or 1 tab) or if you are a clickety-click person, use the 'Code' button. :)

Edited by ~s.o.s~: e

0

pyTony had suggested I use ~~~ because the CODE formatting didn't like VB comments. Has this been fixed?

1

The syntax highlighter is geared towards C/C++/Java-style languages and color-code VB/Python code optimally. For example, it doesn't recognize comments in code. In the near future, code posted in those forums will know to use syntax highlighters specifically for the specified language.

Votes + Comments
Ah, I see!
1

~s.o.s~ Specifically, single quotes tended to screw up the display. Single line comments (beginning with a single quote) or line ending comments (again with a single quote). Here's an example

    Private Sub mnuLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLoad.Click

        'prompt for a file name and load the resulting book library file

        dlgOpen.DefaultExt = ".bkl"
        dlgOpen.AddExtension = True
        dlgOpen.Filter = "Book Library Files|*.bkl"
        dlgOpen.FileName = ""

        If dlgOpen.ShowDialog() = Windows.Forms.DialogResult.OK Then
            LoadBookList(dlgOpen.FileName)
        End If

    End Sub
Votes + Comments
Ah, I thought VB = vBulletin !
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.