Solved

How do I write in IEEE format in VB?

Posted on 2001-08-16
9
394 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

18 Experts available now in Live!

Get 1:1 Help Now