Results 1 to 10 of 10

Thread: [RESOLVED] Some small doubts while reading other posts

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Resolved [RESOLVED] Some small doubts while reading other posts

    Hi..

    While I was reading some posts, I got stuck at certain lines.

    1. Code:
      Public Class IP_ADAPTER_INFO
          Public [Next] As IntPtr
      '......
      Why the square brackets ?
    2. Code:
      Dim Count As Integer = RichTextBox.Text.Split(","c).Length
      What's the use of character c in above code?

    Thanks...

    Edit:
    Ooops. I posted in the wrong section
    Last edited by akhileshbc; Sep 21st, 2010 at 06:11 AM. Reason: wrong section

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  2. #2

  3. #3
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: Some small doubts while reading other posts

    1. they are used to tell the compiler that these are not the predefined words but user defined variables

    2. to conver the string into character

  4. #4
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Re: Some small doubts while reading other posts

    For 2nd one the answer is here

    http://blog.dmbcllc.com/2009/04/08/v...option-strict/

    very good example
    thanks
    amrita

  5. #5

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Some small doubts while reading other posts

    Quote Originally Posted by MartinLiss View Post
    Moved. (Please specify your .Net version)
    Thanks for moving this thread...
    Yeah. I have edited the post added the version too.

    Quote Originally Posted by aashish_9601 View Post
    1. they are used to tell the compiler that these are not the predefined words but user defined variables

    2. to conver the string into character
    Thanks...
    But is Next a predefined word ?

    Quote Originally Posted by amrita View Post
    For 2nd one the answer is here

    http://blog.dmbcllc.com/2009/04/08/v...option-strict/

    very good example
    Thanks...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: Some small doubts while reading other posts

    Quote Originally Posted by akhileshbc View Post
    But is Next a predefined word ?
    you asking this question with a 200+ repute, strange

    http://msdn.microsoft.com/en-us/libr...9t(VS.71).aspx
    http://msdn.microsoft.com/en-us/libr...(v=VS.71).aspx

  7. #7
    Fanatic Member
    Join Date
    Aug 2010
    Posts
    624

    Re: Some small doubts while reading other posts

    Quote Originally Posted by akhileshbc View Post
    Thanks...
    But is Next a predefined word ?
    Yes, Next is predefined, a for-Next loop would be very sorry without it

    Code:
    For <some statement>
    '//method body
    Next

  8. #8

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Some small doubts while reading other posts

    Quote Originally Posted by aashish_9601 View Post
    Quote Originally Posted by J-Deezy View Post
    Yes, Next is predefined, a for-Next loop would be very sorry without it

    Code:
    For <some statement>
    '//method body
    Next
    Ah! Didn't thought about that one

    I was trying to migrate from VB6 to .Net. So, before that I flushed my memory.

    Sorry for my stupid question.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  9. #9
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: [RESOLVED] Some small doubts while reading other posts

    As said, square brackets allow you to use a name (for methods, variables, properties, etc) that is usually reserved for keywords. Other examples are Public, Private, Class, Sub, etc.

    As for your second point, the c indicates that it is a character literal and not a string literal of length 1. Even though a character and a 1-letter string are in all usual senses the same, in .NET they are simply two different classes. I would like to correct aashish_9601's answer though: there is no conversion taking place.
    Code:
    Dim a = "x"
    Dim b = "x"c
    In this code, a is a String and b is a Char.
    The C# equivalent would be
    Code:
    var a = "x";
    var b = 'x';
    Since ' is reserved for comments in VB they had to find a different way to distinguish string and char literals, and they chose for a 'c' suffix.

  10. #10

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: [RESOLVED] Some small doubts while reading other posts

    Thanks Nick

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

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