Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

How to do bit manipulation in VBA?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
curiousgeorge408@hotmail.com - 24 Nov 2007 19:13 GMT
I want to pass a floating-point number to a VBA function and access
the binary representation.  In C, I might declare a union of double
and 8-element unsigned char array, assign the function parameter to
the double, then access the bits of the unsigned char array.
Alternatively, I might use memcpy() to copy the floating-point
parameter into an 8-element unsigned char array.

How can I accomplish that (either one) in VBA?
Gary''s Student - 24 Nov 2007 20:09 GMT
Hi George:

http://groups.google.com/group/microsoft.public.excel.programming/browse_thread/
thread/bf59cb8c21444f5f/486d0799a6ef6d0a?lnk=st&q=%22bit+manipulation+group%3A*e
xcel
#
Signature

Gary''s Student - gsnu2007a

> I want to pass a floating-point number to a VBA function and access
> the binary representation.  In C, I might declare a union of double
[quoted text clipped - 4 lines]
>
> How can I accomplish that (either one) in VBA?
curiousgeorge408@hotmail.com - 25 Nov 2007 01:52 GMT
On Nov 24, 12:09 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> http://groups.google.com/group/microsoft.public.excel.programming/bro...

Thanks for the pointer.  (Sigh, Google Groups seems to be truncating
the URL in this response.)

I did see this thread when I searched GG before posting my inquiry.
But I was unable to look at threads from early 2005 and earlier,
including this one.  I ass-u-me-d that GG kept the NG index, but not
the articles.  (I thought that was odd, but I imagined a dubious
benefit.)  But after I clicked on your link, I discovered that all the
links in the search result now work.  I'm sure it has nothing to do
with clicking on your link.  The earlier failure must've been a hiccup
in the GG intranet.  Klunk!  I'll try to be more patient in the
future.

Anyway, this is a great(!) pointer.  It sparks some follow-up
questions, which are non-technical.  I hope someone will be kind
enough to offer some insight.

First, where can I learn (more) about the user-callable entry points
in the Kernel32 lib -- and any other system libs that might be
accessible to VBA programs?

I don't 'spose there are "man pages" <wink>.

(My VBA book does mention some useful entry points and how to use
them.  But it is not complete, by a long shot.)

Second, where can I learn (more) about the VBA language?

I'm looking for the "K&R" of VBA <wink>.

My VBA book, which is one of the most recommended in these NGs, does
not mention LSET, for example.  At least, not that I recall.  The
book's index is terrible.  So it is possible that LSET is mentioned in
context somewhere, and I simply can no longer find it (like almost
everything else), having no idea in what context the author chooses to
introduce what <sigh>.
Gary''s Student - 25 Nov 2007 13:21 GMT
Hi George:

For API info you might checkout Ivan Moala's site:

http://www.xcelfiles.com/Index.html

or

http://www.answers.com/library/Win+APIs

or

http://www.andreavb.com/API_USER32.html

Have fun with this !

Signature

Gary''s Student - gsnu2007b

> On Nov 24, 12:09 pm, Gary''s Student
> <GarysStud...@discussions.microsoft.com> wrote:
[quoted text clipped - 36 lines]
> everything else), having no idea in what context the author chooses to
> introduce what <sigh>.
curiousgeorge408@hotmail.com - 26 Nov 2007 07:56 GMT
On Nov 25, 5:21 am, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> http://www.answers.com/library/Win+APIs

Thanks for the pointers.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.