Question How to use XCODE tags with Visual Basic snippets?

Rob Sherratt

Well-known member
Joined
Dec 30, 2012
Messages
64
Location
Corfu. Greece
Programming Experience
10+
I tried to use XCODE tags to improve formatting of this post:

http://www.vbdotnetforums.com/windows-forms/55303-using-searchlist-alphabetic-clickable-index-columns-huge-datagridview.html#post155996ML

It didn't have the desired effect, the code snippet was displayed incorrectly so I reverted to using CODE tags instead. I suspect I may not be using the XCODE tags correctly. Please can anyone advise me how to make VB.NET code display correctly and preferably in color like in Visual Studio?

UPDATED: The above thread is now edited using the "XCODE=vb" tags communicated in @jmcilhinney@'s helpful reply below.

Many thanks,
Rob
 
Last edited:
[xcode=vb]your code here[/xcode]

That's it, that's all. When I apply XCODE tags in the simple editor, the code doesn't show up correctly when I first submit. It will to others though, and generally does for me if I refresh the page. Sometimes refreshing the page makes some extra markup appear, but others will still not see that either.
 
@jmcilhinney@

Brilliant! This works for me and looks exactly how I want my code snippets to appear. It's a fantastic Forum facility for publishing VB.NET code.
However at the moment the WYSIWYG "vb" icon generates the following which does not work at all ... I think it's a sort of "bug" on the forum ... given the forum is "vbdotnetforums" after all! :very_drunk:

[XCODE]' Visual Basic code here
Dim RobSherratt as String = "Stupid"[/XCODE]

To make the tags work properly, the user has to know to type "vb" in lower case and not "VB" when prompted for the "option".
Upper case "VB" does not work. I don't think many forum users know that, looking at many other posts which are not displaying VB.NET code nicely.

May I request that the tags generated by the "vb" icon in the WYSIWYG editor are modified to insert the following as default - and that the confusing "option" prompt box is disabled or made a user preference?

' Visual Basic code here
Const RobSherratt as String = "Learning Fast"

If people want to use the XCODE tag to insert other code e.g. C# or PERL then they should use a different forum, not one called "vbdonnetforums", shouldn't they? :bi_polo:

(Last sentence and icon: A joke about programmers with split personalities, not a serious suggestion, I don't intend to cause offence!)

Thanks,
Rob
 
Last edited:
To make the tags work properly, the user has to know to type "vb" in lower case and not "VB" when prompted for the "option".
That is explained in forum FAQ, also with sample.
May I request that the tags generated by the "vb" icon in the WYSIWYG editor are modified to insert the following as default - and that the confusing "option" prompt box is disabled or made a user preference?
It is not possible. Apart from that Xcode has many other options (though there is currently an unresolved bug related to that) that can be useful when posting related to VB development discussions.
 
I searched the forum FAQ for "xcode" and the entire forum for "xcode" and could not find a forum FAQ with examples describing its use.
It's probably just me being stupid, but I'm not finding it easy to navigate and search the forum for help etc.
If such a help topic exists, why doesn't it contain a searchable field called "xcode" ?
 
I searched the forum FAQ for "xcode" and the entire forum for "xcode" and could not find a forum FAQ with examples describing its use.
It's probably just me being stupid, but I'm not finding it easy to navigate and search the forum for help etc.
If such a help topic exists, why doesn't it contain a searchable field called "xcode" ?

Because xcode is just one of the tags available for formatting. These are not features specific to this forum. They are widely used all over the web and, if I'm not mistaken, actually predate the web. The very first FAQ, entitled "Posting New Messages", says:
How do I format my posts and messages?
It goes on to mention BB code and provide a link to all the supported BB code tags. That list includes xcode and provides an example.
 
@jmcilhinney@

Would you like me to write a short section headed "How to publish code snippets, e.g. Visual Basic, in your posts." for possible inclusion in the FAQ?
It is missing from the FAQ topics. To admins it is obvious, to many forum members - some experts - it is not obvious at all.
Because the material is buried in a sub-topic called "BB Code List", the necessary information is not being found by most forum members.
In case it helps others, the link is here:

BB Code List - Visual Basic .NET Forums

Look at a cross section of threads on this forum. 70% of people are not applying the correct formatting to code snippets.
 
Because the material is buried in a sub-topic called "BB Code List", the necessary information is not being found by most forum members.
It would appear few bothers reading the FAQ at all. See the last line in my post signature also, it has been around for years and is all over this place, the thread in question has been read about 17.000 times by the 39.000 registered users.
 
Back
Top