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. General Programming
  3. Visual Basic
  4. what this code means?

what this code means?

Scheduled Pinned Locked Moved Visual Basic
question
7 Posts 5 Posters 1 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.
  • A Offline
    A Offline
    ArielR
    wrote on last edited by
    #1

    sCmd = Chr(&H8s) & Chr(&H2s)

    E L G C 4 Replies Last reply
    0
    • A ArielR

      sCmd = Chr(&H8s) & Chr(&H2s)

      E Offline
      E Offline
      ESTAN
      wrote on last edited by
      #2

      try: Console.WriteLine(sCmd) and check the output.

      1 Reply Last reply
      0
      • A ArielR

        sCmd = Chr(&H8s) & Chr(&H2s)

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, &H8s is an integer value; the &H prefix indicates hexadecimal, the s suffix indicates a short type; so it really is the number 8 (and there was no need to use hex in the first place). Chr() is a function that turns a number into the character with that ASCII value. And the & operator is used here to concatenate. Therefore sCmd will be assigned a string consisting of two characters whose ASCII values are 8 and 2. If you were not able to discover this yourself, either by experimenting, or by googling, I would suggest you work your way through a book on VB.NET to become familiar with it. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


        E A 2 Replies Last reply
        0
        • A ArielR

          sCmd = Chr(&H8s) & Chr(&H2s)

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          The same as: sCmd = (Convert.ToChar(8)).ToString() + (Convert.ToChar(2)).ToString()

          --- single minded; short sighted; long gone;

          1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, &H8s is an integer value; the &H prefix indicates hexadecimal, the s suffix indicates a short type; so it really is the number 8 (and there was no need to use hex in the first place). Chr() is a function that turns a number into the character with that ASCII value. And the & operator is used here to concatenate. Therefore sCmd will be assigned a string consisting of two characters whose ASCII values are 8 and 2. If you were not able to discover this yourself, either by experimenting, or by googling, I would suggest you work your way through a book on VB.NET to become familiar with it. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


            E Offline
            E Offline
            ESTAN
            wrote on last edited by
            #5

            nice explanation :->

            1 Reply Last reply
            0
            • L Luc Pattyn

              Hi, &H8s is an integer value; the &H prefix indicates hexadecimal, the s suffix indicates a short type; so it really is the number 8 (and there was no need to use hex in the first place). Chr() is a function that turns a number into the character with that ASCII value. And the & operator is used here to concatenate. Therefore sCmd will be assigned a string consisting of two characters whose ASCII values are 8 and 2. If you were not able to discover this yourself, either by experimenting, or by googling, I would suggest you work your way through a book on VB.NET to become familiar with it. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


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

              Thank you very much

              1 Reply Last reply
              0
              • A ArielR

                sCmd = Chr(&H8s) & Chr(&H2s)

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                It means someone came from VB.NET via VB6 and hasn't learned to write clean code, yet.

                Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                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