Solved

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

Posted on 2007-11-20
2
496 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

710 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