Solved

Convert a non printable ACSII char to a decimal value

Posted on 2009-07-14
2
426 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 500 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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.
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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