Solved

Visual Basic Formatting Hex(number) to String - Dropping Characters

Posted on 2007-11-20
2
497 Views
Last Modified: 2012-08-14
Debugging a program written by someone else (not available)  The following statement yields different results depending on the decimal number:    String = Format(Hex(integer))

If the integer = 3342528 then String = 0x3300C0
If the Integer = 3342544 then String = 0x3300 , not 0x3300D0 as expected.

Why?
0
Comment
Question by:rogerkirk
[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 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 20323583
Don't use the Format function. You will get the desired result.

String = Hex(Value)

Kevin
0
 

Author Closing Comment

by:rogerkirk
ID: 31410233
Thank you!  Thank you!  Thank you!  
Production may now resume!  I can enjoy Thanksgiving!
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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