Results 1 to 24 of 24

Thread: [RESOLVED] ' and //

  1. #1

    Thread Starter
    Lively Member TETYYS's Avatar
    Join Date
    May 2010
    Location
    Spam Land
    Posts
    116

    Resolved [RESOLVED] ' and //

    is possible to change VB.NET's ' to C++'s //?
    I want to change it because // is cool

    500 B.C. - 2011
    Quote Originally Posted by techgnome View Post
    VB's ' has twice the power of C's / ... that's why it takes two / to equal one '

    -tg

  2. #2
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: ' and //

    No, it's not.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: ' and //

    only if you use C# ... but then it's not VB...
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Lively Member TETYYS's Avatar
    Join Date
    May 2010
    Location
    Spam Land
    Posts
    116

    Re: ' and //

    why? WHY THE VB IS SO RETARDED?

    500 B.C. - 2011
    Quote Originally Posted by techgnome View Post
    VB's ' has twice the power of C's / ... that's why it takes two / to equal one '

    -tg

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ' and //

    Quote Originally Posted by TETYYS View Post
    is possible to change VB.NET's ' to C++'s //?
    I want to change it because // is cool
    Yes...but to do so you would have to secure employment with Microsoft and get placed on their VB.NET development team.

    Next, you would need to submit a change request that ran through your boss up throught the Microsoft VB.NET Team Lead, who would have to get sign offs from a variety of company officials above him/her.

    Naturally, legacy support for the apostrope would have to be retained even if your request to include the double backslashs in the next, and all future releases of VB.NET, were to be accepted.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ' and //

    Quote Originally Posted by TETYYS View Post
    why? WHY THE VB IS SO RETARDED?
    On the contrary...it is very advanced with the C++ being behind the times.

    To type a comment in VB all you need to do is type one character then your comments. The other thing requires the typing of two characters and then your comments. Why do you want to double your own work?

  7. #7

    Thread Starter
    Lively Member TETYYS's Avatar
    Join Date
    May 2010
    Location
    Spam Land
    Posts
    116

    Re: [RESOLVED] ' and //

    // looks cool

    500 B.C. - 2011
    Quote Originally Posted by techgnome View Post
    VB's ' has twice the power of C's / ... that's why it takes two / to equal one '

    -tg

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    VB's ' has twice the power of C's / ... that's why it takes two / to equal one '

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [RESOLVED] ' and //

    The change I would like to see is the ability to have the C style /*....*/ comments. While VB allows you to easily comment/uncomment a block, it still isn't all that convenient for typing lengthy comments, such as at the beginning of methods.

    Other than that, if your choice of language is due to style of the single line comment identifier, you are paying more attention to the chaff than the wheat. Do you also see all the other operators in C-style languages as being 'more cool' than the words used in VB? I thought that using &, ^, !, and | operators made for some pretty tight looking code...then I tried using them in practice. What a pain. Any good typist will do better in VB than in C-style languages, and this is true for the comment designator as well as all the other operators.
    My usual boring signature: Nothing

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    Shaggy - did you know that if you type ''' just above the method, you get a comment block? And if you start typing in the Comment/Summary section, and press enter, it will add the leading ''' to the next line:
    Code:
    Public Class Form1
    
        ''' <summary>
        ''' if you start typing here, and simply press return
        ''' it will auto comment the new line for you.
        ''' handy for comment blocks in VB...
        ''' </summary>
        ''' <param name="sender"></param>
        ''' <param name="e"></param>
        ''' <remarks></remarks>
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
        End Sub
    End Class
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  11. #11
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [RESOLVED] ' and //

    No, I certainly didn't. That is almost what I want, and I can certainly see the value of that, since it can be used for structured commenting. I guess that was one of the items that was added more or less recently (since 2003), which I have not yet made use of.
    My usual boring signature: Nothing

  12. #12
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    Not sure if it was in 2005 or not, but it was there by 2008 (where I copied that from). It's even smart enough to pick up the parameters too and prefill what it can.

    It's designed to go with Sandcastle for producing automated MSDN-style documentation for your app.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  13. #13
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] ' and //

    Quote Originally Posted by techgnome View Post
    Not sure if it was in 2005 or not, but it was there by 2008 (where I copied that from). It's even smart enough to pick up the parameters too and prefill what it can.

    It's designed to go with Sandcastle for producing automated MSDN-style documentation for your app.

    -tg
    ????? "It's even smart enough to pick up the parameters too and prefill what it can." How do you do that?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  14. #14
    Addicted Member
    Join Date
    Apr 2008
    Posts
    193

    Re: [RESOLVED] ' and //

    Quote Originally Posted by TETYYS View Post
    // looks cool
    If it means that much to you, you could do this...

    Code:
            ' Lame comment...
            '// Really cool comment ;)

  15. #15
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    dbasnett - beats me... it just does it... if you look at the code I posted above, all I did was tap that ' key three times.... and it takes the parameters from the method, and creates the parameter nodes exactly as you see it. Other than ''', the only text I entered was the three lines in the summary node.

    Now... what it DOESN'T do is pick up new parameters if you add something... it only pre-fills the parameters that are there when the comment block is first created. After that, it's up to you for maintenance.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  16. #16
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: [RESOLVED] ' and //

    Also, if you Right Click the method, you can select 'add comment' (mouse drivers and keyboard drivers are both accommodated...)

    If you add a parameter, you can add the parameter to the comment for that parameter quite easily; typing '<' will bring up a drop-down menu with any missing, uncommented, parameters.

    All these comments are available in the XML documentation file generated at compilation (unless the XML documentation selection is unchecked).
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  17. #17
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] ' and //

    Now I see

    Code:
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <param name="bar"></param>
        ''' <param name="xyz"></param>
        ''' <param name="loob"></param>
        ''' <remarks></remarks>
        Private Sub foo(ByVal bar As Integer, ByVal xyz As String, ByVal loob As Boolean)
    
        End Sub
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  18. #18
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    if you Right Click the method, you can select 'add comment'
    Now that I didn't know. Typically, when I can, I stick to keyboard shortcuts. Still, good to know.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  19. #19
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [RESOLVED] ' and //

    dbasnett - now remove one of the parameters from your procedure signature... you should then get a schema error in the comments block for the removed parameter. Unfortunately it doesn't do the same for added parameters.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  20. #20
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] ' and //

    WOW! What it does with IntelliSense is priceless!

    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, _
                                  ByVal e As System.EventArgs) Handles Button1.Click
    
            If foo( 'fix me <<<<<<<<<<<<<<<<<<<<<<
        End Sub
        ''' <summary>
        ''' The is cool!
        ''' </summary>
        ''' <param name="bar">bar is cool</param>
        ''' <param name="xyz">xyz starts with x</param>
        ''' <param name="loob">is bool backwards</param>
        ''' <returns>returns a double</returns>
        ''' <remarks>who need remarks</remarks>
        ''' <exception cref="DivideByZeroException">
        ''' When you divided by zero, DUH!
        ''' </exception>
        Private Function foo(ByVal bar As Integer, ByVal xyz As String, ByVal loob As Boolean) As Double
            Try
    
            Catch ex As DivideByZeroException
    
            End Try
            Return New Double
        End Function
    here are some links for those not having them
    http://msdn.microsoft.com/en-us/magazine/dd722812.aspx

    http://msdn.microsoft.com/en-us/libr...%28v=VS.100%29
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  21. #21
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    407

    Re: [RESOLVED] ' and //

    I used to be driven crazy because with VB you couldn't multiline comment. But then I figured out that if highlight the section you want commented then do CTRL-K, then CTLR-C will do the trick. To Uncomment do CTRL-K, CTRL-U. There's a cheat sheet for all the commands at
    http://www.microsoft.com/downloads/e...c-84036160639f

    I've also found out that bookmarks are nice too.
    My Websites
    SharpMP3 - MP3 Design Articles www.sharpmp3.com
    Yobbers - Job Search www.yobbers.com
    Lets Trend - Methods For Riding Stock Trends www.letstrend.com

  22. #22
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [RESOLVED] ' and //

    There are also buttons on the toolbar that will do all that commenting with single button clicks if you can't remember the ctrl keys.
    My usual boring signature: Nothing

  23. #23

    Thread Starter
    Lively Member TETYYS's Avatar
    Join Date
    May 2010
    Location
    Spam Land
    Posts
    116

    Re: [RESOLVED] ' and //

    Quote Originally Posted by CodeDabbler View Post
    If it means that much to you, you could do this...

    Code:
            ' Lame comment...
            '// Really cool comment ;)
    If It Impossible To Do // My Technique Will Be '//

    P.S. This Thread Is Like A Chat!
    Last edited by TETYYS; Dec 31st, 2010 at 11:37 AM.

    500 B.C. - 2011
    Quote Originally Posted by techgnome View Post
    VB's ' has twice the power of C's / ... that's why it takes two / to equal one '

    -tg

  24. #24
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] ' and //

    Quote Originally Posted by techgnome View Post
    dbasnett - beats me... it just does it... if you look at the code I posted above, all I did was tap that ' key three times.... and it takes the parameters from the method, and creates the parameter nodes exactly as you see it. Other than ''', the only text I entered was the three lines in the summary node.

    Now... what it DOESN'T do is pick up new parameters if you add something... it only pre-fills the parameters that are there when the comment block is first created. After that, it's up to you for maintenance.

    -tg
    If you like the above, then you might want to take a look at GhostDoc:

    http://submain.com/products/ghostdoc.aspx

    Also, if you throw StyleCop into the mix:

    http://code.msdn.microsoft.com/sourceanalysis

    It will tell you when you have parameters that don't have matching XML comments, and vice versa.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width