Solved

How do I write in IEEE format in VB?

Posted on 2001-08-16
9
401 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 50 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access query that references subform 5 47
MS Date Picker 64 bit 32 bit issue 12 53
VBA: Select SQL query based on a config Sheet v2 11 44
RUNRMTCMD from AS/400 12 46
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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