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
  1. Home
  2. General Programming
  3. Visual Basic
  4. int to a

int to a

Scheduled Pinned Locked Moved Visual Basic
c++question
7 Posts 4 Posters 0 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.
  • P Offline
    P Offline
    pnpfriend
    wrote on last edited by
    #1

    Hi all! how can I convert the number ( 42 ) to A I mean in ASCII code 42 is an "A" so If I have number 42 how can I convert it into "A" in VB. I know that in C++ I can used IsAlpha(). Thanks

    S 1 Reply Last reply
    0
    • P pnpfriend

      Hi all! how can I convert the number ( 42 ) to A I mean in ASCII code 42 is an "A" so If I have number 42 how can I convert it into "A" in VB. I know that in C++ I can used IsAlpha(). Thanks

      S Offline
      S Offline
      SimonS
      wrote on last edited by
      #2

      Hi Win Here's the VB.NET code (hope this is the VB ver. you wanted):

      Imports System.Text.Encoding
      Imports Microsoft.VisualBasic

      Module Module1

      Sub Main()
          Dim i As Integer = AscW("A")
          Console.WriteLine(i.ToString())
          Dim c As Char = ChrW(i)
          Console.WriteLine(c.ToString())
          Console.ReadLine()
      End Sub
      

      End Module

      Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG

      P 1 Reply Last reply
      0
      • S SimonS

        Hi Win Here's the VB.NET code (hope this is the VB ver. you wanted):

        Imports System.Text.Encoding
        Imports Microsoft.VisualBasic

        Module Module1

        Sub Main()
            Dim i As Integer = AscW("A")
            Console.WriteLine(i.ToString())
            Dim c As Char = ChrW(i)
            Console.WriteLine(c.ToString())
            Console.ReadLine()
        End Sub
        

        End Module

        Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG

        P Offline
        P Offline
        pnpfriend
        wrote on last edited by
        #3

        Thanks Simon. That's exactly what I want. Thanks millions....

        S 1 Reply Last reply
        0
        • P pnpfriend

          Thanks Simon. That's exactly what I want. Thanks millions....

          S Offline
          S Offline
          SimonS
          wrote on last edited by
          #4

          Cool, glad it helped. The wierd thing is that MS/other seem to recommend not using the Microsoft.VisualBasic namespace as (I think) it uses interop in the background. Perhaps keep this code in a single function so it won't be too much of a sweat to change later, if necessary. I'll keep a look out for an alternative. Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG

          N 1 Reply Last reply
          0
          • S SimonS

            Cool, glad it helped. The wierd thing is that MS/other seem to recommend not using the Microsoft.VisualBasic namespace as (I think) it uses interop in the background. Perhaps keep this code in a single function so it won't be too much of a sweat to change later, if necessary. I'll keep a look out for an alternative. Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG

            N Offline
            N Offline
            Nick Seng
            wrote on last edited by
            #5

            Hmmm.....isn't easier to use the Chr function??

            Chr(65) = "A"

            Notorious SMC


            The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
            Get your facts first, and then you can distort them as much as you please Mark Twain

            R P 2 Replies Last reply
            0
            • N Nick Seng

              Hmmm.....isn't easier to use the Chr function??

              Chr(65) = "A"

              Notorious SMC


              The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
              Get your facts first, and then you can distort them as much as you please Mark Twain

              R Offline
              R Offline
              Ray Cassick
              wrote on last edited by
              #6

              Would have been the way I would go.


              Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
              George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."


              1 Reply Last reply
              0
              • N Nick Seng

                Hmmm.....isn't easier to use the Chr function??

                Chr(65) = "A"

                Notorious SMC


                The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
                Get your facts first, and then you can distort them as much as you please Mark Twain

                P Offline
                P Offline
                pnpfriend
                wrote on last edited by
                #7

                I used Chr(). Thanks

                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