Solved

Visual Basic CLng() return problem

Posted on 2004-04-19
11
1,473 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
11 Comments
 
LVL 12

Expert Comment

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

Expert Comment

by:venkateshwarr
ID: 10865148
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 10865163
Sorry I need Hex to To decimal, had them backwards.
0
 
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 8

Expert Comment

by:harris_c
ID: 10866528
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoreUp challenge 14 48
How to split this in C++ 4 78
find a node in VST 2 47
Tembedded WB animatid gifs not animated on some pcs 2 36
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now