Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I write in IEEE format in VB?

Posted on 2001-08-16
9
Medium Priority
?
411 Views
Last Modified: 2012-06-27
How do you write in IEEE format in VB?
0
Comment
Question by:joesmow
9 Comments
 
LVL 2

Expert Comment

by:Lunchy
ID: 6395223
<ping>
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 200 total points
ID: 6395264
I am not even sure where this is coming from and I really cannot see much use for this these days, but I believe you are looking for something like the old MKI$, MKL$, MKS$, MKD$ functions.  The MK?$ functions convert numeric values to strings by placing the ASCII value of each byte that represents the numeric value into a string.

So for example the following will work for variables of type long (4 bytes)

Private Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)

Private Sub Command1_Click()

Debug.Print MKL(123456)

End Sub

Function MKL(x As Long) As String
Dim Temp As String

Temp = Space$(4)
CopyMemory ByVal Temp, x, 4
MKL = Temp

End Function

Anthony
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6395346
>How do you write in IEEE format in VB?

Which IEEE format exactly are you looking for?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 38

Expert Comment

by:PaulHews
ID: 6395353
The reason I ask is because Double variable types are IEEE 64 bit floats.  Singles are IEEE 32-bit floats.  What other type would you be looking for?
0
 
LVL 6

Expert Comment

by:JonFish85
ID: 6395647
mind if I ask what exactly IEEE format is?! I know its probably a stupid question, but I havent a clue what it means...
0
 
LVL 6

Expert Comment

by:pierrecampe
ID: 6396821
I may be way off here but i think that VB uses IEEE format does it not ?
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6396911
Yes Pierre, for single and double, vb follows IEEE specifications for those datatypes.  There are other specifications that he might want, but unless he tells us we won't be able to help.

JonFish, IEEE stands for Institute of Electrical and Electronics Engineers, they design a lot of industry standards for electronics and IT.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6399454
Nicely done Anthony.  :) But what was the question about?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6404644
Paul,

Who knows!  Talk about a blast from the past.  I have not used those functions in nearly 10 years.  I remember the angst it created some deveopers when they were dropped going from MS Basic to Visual Basic.  Something similar going on now with some archaic functions getting dropped going to VB.NET.

Anthony
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

927 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