[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Convert a non printable ACSII char to a decimal value

Posted on 2009-07-14
2
Medium Priority
?
435 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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