?
Solved

Convert a non printable ACSII char to a decimal value

Posted on 2009-07-14
2
Medium Priority
?
431 Views
Last Modified: 2012-05-07
THe routine below converts a string value of w to the ASCII equivalent of Dec 119, if i had a non printable character how could i convert it to a Dec?

For example the decimal value of 10
Public checksumchar As String = "w"
    Public Associatedchecksum(0) As String
 
 Private Sub Data_CheckSum()
        Dim myChars() As Char
        myChars = checksumchar.ToCharArray()
        Associatedchecksum(0) = AscW(myChars(0))
    End Sub

Open in new window

0
Comment
Question by:cmdolcet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24853210
Yes I believe that works in most cases.  I know the line feed (nl) character does or at least it did for me.
Public checksumchar As String = vbLf
    Public Associatedchecksum(0) As String
 
 Private Sub Data_CheckSum()
        Dim myChars() As Char
        myChars = checksumchar.ToCharArray()
        Associatedchecksum(0) = AscW(myChars(0))
    End Sub

Open in new window

0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 24853247
Here is an extended character that works, get 8226.  Note AscW works for unicode character set from 0 to  65535.

http://msdn.microsoft.com/en-us/library/zew1e4wc(VS.80).aspx
Public checksumchar As String = """
    Public Associatedchecksum(0) As String
 
 Private Sub Data_CheckSum()
        Dim myChars() As Char
        myChars = checksumchar.ToCharArray()
        Associatedchecksum(0) = AscW(myChars(0))
    End Sub

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question