|
-
October 5th, 2002, 01:58 PM
#1
anyone here familiar with VB?
Here's the story, I'm used to QB, and have 'basically' learned to program in VB the rough way, through the online help, and primarialy my programming tends to occur inside Excel. So now I got a situation where I need to use CVL, or ConVert Long, to take a compacted value and extract it to a decimal value. Only the best info I've found leads me to using the CopyMemory alias function, courtesy of a heavy duty search of MS which lead to Windows API Guide for it details many API functions. Only it don't work, the values are very different.
I really hate asking questions like this over in the newsgroups which are supposed to help people with questions like this for what seems to happen is a MVSP answers the question, and if their answer doesn't work, obviously you're too stupid to understand it.
-
October 5th, 2002, 03:36 PM
#2
Don't really understand your post. You have a compacted value that you want to convert to a long integer, so you use CVL to convert it to a long integer? Is that correct? If so doesn't VB contain a function to convert to single precision or double precision to give you a decimal value? Used to be CDBL and CSNG. It's been a very long time since I used VB.
-
October 5th, 2002, 06:34 PM
#3
Originally posted by Jubal
Don't really understand your post.
Bummer, I'm getting worse!
No, under QB and older forms of basic, if you wanted to store numbers into a random access file, you could go about it in two ways.
1) Convert the number to a string and allocate enough bytes in the random file to cover the biggest number.
2) Convert the number into a packed representation of the number resulting in a savings on bytes, very important back in the days of limited memory.
The Target of my conversion is some old fashioned data files in which method 2 was used, several numbers are compacted by MKL$, and now I'd like to use an Excel VBA program to read the values back. Only VB dropped the function, hence I gotta attack it by another means.
-
October 5th, 2002, 11:03 PM
#4
Have a look here. It may explain better how to use CopyMemory (aka RTLMoveMemory) to do what you want.
Please remember to post back whether your problem is resolved or
not, so that others may gain from the knowledge.
-
October 6th, 2002, 01:44 PM
#5
That works, though I'll be puzzled how.
Mainly because it the exact same thing I tried, except that I was attempting to use the function inline, instead of calling it as a sub routine.
Most curious.
Now if only I can figure out the date coding of the file I'll be alright.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|