Solved

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

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 79
Copy a row 12 62
How to set the sa password in a vb6 code for sql connection 9 55
Excel Automation VBA 19 76
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

831 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