Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual Basic CLng() return problem

Posted on 2004-04-19
11
Medium Priority
?
1,552 Views
Last Modified: 2007-12-19
I am trying to run CLng() to convert decimal to hex inside one of my functions.  The problem is when clng runs in my function it bumps out of the function.  It will not return to the next line in my function.  Any ideas or better ways to convert dec to hex?
0
Comment
Question by:bluedragon99
[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
11 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10865138
you can use Hex() function.
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 10865163
Sorry I need Hex to To decimal, had them backwards.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:rajaloysious
ID: 10865307
Use the VAL function and i hope that is it all it takes to solve your problem
Good Luck
0
 
LVL 1

Expert Comment

by:vware
ID: 10866804
try
Debug.Print Val("&H" & CStr(DecimalValue))
0
 
LVL 5

Expert Comment

by:avya2k
ID: 10867548
what is the error and at which code segment
0
 
LVL 2

Expert Comment

by:Ivan_Skrinjaric
ID: 10867622
If you wont long try clng("&H" & cstr(number))
0
 
LVL 3

Accepted Solution

by:
elantra earned 2000 total points
ID: 10872824
Here is a function that will convert Hex -> Dec.  Just pass the function your hex value.  Example:  

MsgBox HexToDec(InputBox("Enter a HEX value:"))

---------------------------------------------------------------------------------------------------

Function HexToDec(HexNumber)
    HexToDec = CLng("&H" & HexNumber)
End Function
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 10894351
very nice!
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 10894357
function in a function hehe
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

618 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